What is the difference between fgets, getline and sscanf
and why getline and sscanf are usually used together?
What is the difference between fgets, getline and sscanf
and why getline and sscanf are usually used together?
Last edited by Max; 10-25-2002 at 06:26 PM.
Hope is the first step on the road to disappointment.
Thanks Quzah....by the way it is not homework...I just wanted to know the relationship.....I was always confused....but why do we need sometime to use getline followed by sscanf??
>but why do we need sometime to use getline followed by sscanf??
I don't know of any commonly used getline outside of C++, but fgets and sscanf is used a great deal because it is safer to read a line from input and then parse it yourself instead of hoping that it is formatted correctly for scanf.
-Prelude
My best code is written with the delete key.