How do you read a line from stdin ?
i lost my time with gets which seems not te be available.
Tried to use FGets, but get errors.
How do you read a line from stdin ?
i lost my time with gets which seems not te be available.
Tried to use FGets, but get errors.
FGets (Input(),buffer,buffer_size);
Thanks Thomas.
I searched more than an hour for this info.
Any idea why this program does not give me the opportunity to enter a string?
8.Amiga OS 4:S> guis:c/test
Please enter a string
str
8.Amiga OS 4:S>
int main(void) { char str[100]; Printf("Please enter a string\n "); FGets(Input(), str, 80); Printf("str %s\n",str); ///printf( makeupper(str)); return 0; }
Have you tried scanf() ?
Simon
Any idea why this program does not give me the opportunity to enter a string?
I don't have the possibility to try it out soon. But I guess it has something to do with buffered I/O which might not be supported by the CON window. Try this instead:
Read (Input(), str, 80);
Note that this only works for a window. If you read from a file it will not stop at \n.