You can't just replace all occurances of "gets" with "fgets" in your code. (The errors are because fgets takes an extra parameter.) Try this:
->Code:gets(s);
Note that s must be an array and you must have included <string.h>.Code:char s[SOMETHING], *p; fgets(s, sizeof(s), stdin); if((p = strchr(s, '\n'))) *p = 0;