Quote:
Originally Posted by WingedPanther
Try using the getline() function.
|
The OP said he was using C. There is no getline() in C.
(If the OP is cool with using C++ he should say so).
To the OP: if you just need to read a sentence into a string, try fgets:
fgets(buff, 80, stdin);
would read 80 chars from stdin, or up to end of line or end of file, whatever comes first.
What it reads goes into buff, which should be declared
char buff[81];
If you want to read such a string from a file, say FILE *f then just say
fgets(buff, 80, f);
assuming f has been opened.