-
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:
char s[SOMETHING], *p;
fgets(s, sizeof(s), stdin);
if((p = strchr(s, '\n'))) *p = 0;
Note that s must be an array and you must have included <string.h>.
-
thanks for you help guys
thank you guys this forum Rocks!
-
I am assuming gets reads standard input so you need to
tell fgets that so...par example
gets(filename);
would become
fgets(stdin,filename);
Basically you are telling fgets which file to read.