Hello everyone, I wanna ask that what is the meaning of the return value of sscanf?
I've seen people use sscanf return value to check their string..
eg.
cheers!Code:if( sscanf(string, "%d", &value) != 1 ){ //Do something }
Hello everyone, I wanna ask that what is the meaning of the return value of sscanf?
I've seen people use sscanf return value to check their string..
eg.
cheers!Code:if( sscanf(string, "%d", &value) != 1 ){ //Do something }
All the scanf() family of functions, return the number of items that have been scanned, and stored.
ah ok! thank you very much ^ ^
We should call GOOGLE and tell them that searching for scanf() doesn't seem to work...
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers
Do not google for C functions: you may hit a page with wrong information.
Go to POSIX.1-2008 and look there
The POSIX site has descriptions of some functions that are not in Standard C (and some content that is not Standard) but that is easily identified and filtered out when needed.
So because of one site we should not use Google? C'mon, get real. Google will give hundreds of sites. After checking one site, choose another two for verification. Takes a minute. Any discrepancies/confusion, check a couple more. If you decide a site gave bad information, you know not to check that site again. But to not use Google is ludicrous.
Anyway, isn't the above what experts do? I know I do. If you don't, better start...
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers
All I know is, I tried to get scanf() to return watermelons, or a good beer.
It refused to cooperate!
Google was no help whatsoever!
I did try to search google, can't find a page that explains it.. or probably just missed the line o.O
EDIT... well yes.. i guess i missed the line thanks anyways
Last edited by dendeer82; 09-16-2012 at 06:57 PM.