I direct this thread spacifically to Sebastiani, Hammer or Prelude
who seem to know their C code.
I'm new to this forum and I note that several contributers don't like
the "gets" command. I write industrial C code on Unix and use:
// CODE
gets(input);
sscanf(input, "%s", input);
exclusively to get input from the user.
My code gets run several hundred thousand times a year and I've never had a problem with this sequence.
I also use:
// CODE
fgets(fd, length);
sscanf(input, "%s", input);
to read from files with no problems.
Is there some problem with "gets" that I should know about?
note:
I used:
void main(void)
in my example but would never use that line in a real program.
This line would normally be:
int main(int argc, char *argv[])
Also I'm writing this from memory at 1:30 in the morning so excuse any stupid mistakes.