I found this inside a scanf...
%[^/n]
I've been searching what it's mean. Would you help me out?
I found this inside a scanf...
%[^/n]
I've been searching what it's mean. Would you help me out?
Read a string until a newline is found, I don't think it's part of the standard - more of a compiler extension.
[] is a list of characters to accept, ^ means the characters in the brackets won't be accepted.
Basically,
Code:%s = %[]So if you only wanted to stop reading at a comma, fullstop or space it'd look like:Code:%1024s = %1024[]
Or if you only wanted to read commas, fullstops or spaces,Code:%[^,. ]
Code:%[,. ]
Last edited by zacs7; 11-11-2007 at 03:44 AM.
It is part of C99, at least.Read a string until a newline is found, I don't think it's part of the standard - more of a compiler extension.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)