C scanf statements
I know C is somewhat outdated and pretty limited (comparatively), but I have a question about scanf (equivalent to cin) statements. I'm used to programming on PC's using Microsoft Visual C++, and for a long time I've been using a certain command that goes something like:
scanf("%[^\n]", buffer);
which reads a string into 'buffer' until coming to a newline character. This command is recognized when compiled with xTools, but it does something weird where it doesn't wait for the user's input and scans in an empty string. Does anyone know how to make it not do this, or know another command for C that scans everything until a newline (including whitespace)?
And yes, I've already put "fflush(stdin);" before the scanf statements.
~Jason
iMac G5, 2GHz, 17", 1GB RAM Mac OS X (10.4.8) xTools ver. 2.4.1