The invalid option is because fgets() keeps the ‘n’ when you press enter, try this
if(!fgets(line, BUFFER_LEN, stdin))
break;
size_t length = strlen(line);
if (line[length – 1] == ‘n’)
line[length – 1] = ‘
by James Palmer
The invalid option is because fgets() keeps the ‘n’ when you press enter, try this
if(!fgets(line, BUFFER_LEN, stdin))
break;
size_t length = strlen(line);
if (line[length – 1] == ‘n’)
line[length – 1] = ‘