View Single Post
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: read each line of file

 
0
  #3
Feb 5th, 2007
Originally Posted by donaldunca View Post
But I don't know how to read file "data.inp" line by line. I think I should use fgets, but seem that fgets is used for char.
Yes, use fgets() to read the line, then you can use sscanf() to convert the line into numbers.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote