I found this inside a scanf...
%[^/n]
I've been searching what it's mean. Would you help me out?
Printable View
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:%[,. ]
It is part of C99, at least.Quote:
Read a string until a newline is found, I don't think it's part of the standard - more of a compiler extension.