#gets fgets use
Hello to all you Amiga faithful.
I have been trying to use gets or fgets (with keyboard as stdin) to try
and avoid scanf(). I haven't been able to make it work right.
If I use gets or fgets alone the function goes right past them as if
they aren't there. If I put them in a loop such as:
while (gets (buf) != (char*) NULL)
or while (fgets (buf, 80, stdin) != (char*) NULL)
the program stays in the loop after I hit return or even overshoot the 80
characters. How do I get the routine to end on the carriage return?
What I'm trying to do is use it to fill a comment string in a record
structure of a file.
To avoid long threads of wasted forum memory, please accept my thanks
now for your advice.
Henry