Hello every one,
I was looking for ways to stop using scanf() as it has got the obvious bug when handling string data,
and also sometimes it holds the inputs coming from stdin ,and i have to use fflush() to flush out the input, which again is harmful.
Looking at a few forum threads here ,many have recommended using fgets() with sscanf(),simply put(please correct me if i am wrong) we are getting the data from the user through fgets() and extracting the data from a buffer(linked to fgets()) in a formatted way using sscanf() .
Now looking at sscanf() example from
sscanf - C++ Reference
a.I am confused as to why there is a pointer "%*s" in the statement rather than just "%s" ?
b.If, char sentence = "12 abc 24";
sscanf( buffer, "%d %d", &int1,int2 );
will int1 contain 12 and int2 contain 24?