doubt between fscanf and fgets

fscanf does not perform bounds checking. fgets is likely going to be the better choice. You can then use sscanf() to evaluate it.

more info
IBM TPF Product Information Center
fscanf - C++ Reference
fgets - C++ Reference
scanf vs fgets?

BTW one more thing, never use scanf for input, use cin. Google it up if u want to know why, too many reasons for me to type
 

Liverpool_fan

Sami Hyypiä, LFC legend
but the advantage(s) of C++ over C must be kept in mind
???
Not sure how std::cin can be an advantage of C++ over C? Only advantage I can think of that you have to specify the format for the input in scanf which is not needed in std::cin. However both exhibit similar behaviour since they are usually implemented as line buffered.
 
^^ yes that, i'am sorry about the post.
i should have explained it.
reading this post now, i sound a lot like my coll professors

u explained it very well. thankyou
 
Top Bottom