Read your reference material about how the standard fscanf() function works.
While your are there, read about gets() as well. If it is a good reference it would tell you to never use it.
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218
use fgets() -- never ever gets() -- to read the entire line from a file or from the keyboard.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
That's true -- it doesn't take one parameter. You need to look up the functions you want to use either in your compiler's printed docs (if they still have them) or on the net (ever hear of google?). Don't just toss functions on a *.cpp file and expect the program to compiler.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
You guys keep telling me to look in the docs. Well, if I understood the docs, then I wouldn't be here.
Well, then the reasonable thing to do first would be to learn how to understand the documentation. Because you are not going to get very far by depending on others to tell you how you should program. Expecting that someone would be always willing to hold your hand is not going to work neither.
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
while the file is being read if in between it is closed then how it will be able to read and perform other functions.
I think you should use fread() function to read the files.
ajay.krish123
Junior Poster in Training
90 posts since Nov 2008
Reputation Points: 6
Solved Threads: 9