![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| fscanf | abey | High Level Programming | 4 | 02-14-2006 09:29 AM |
| fscanf() | j_t_kim | High Level Programming | 3 | 04-03-2002 07:59 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
fscanf()
thanks to everyone for your earlier replies, but i have yet another problem with file i/o. i'm trying to read multiple lines with the same file, and have been using the following code to take in the first two lines from a file...
fscanf(fileptr, "%d %d %d %d %d %d\n", &n1, &n2, &n3, &n4, &n5, &n6); ...some code in between... fscanf(fileptr, "%d %d %d %d %d %d\n", &n1, &n2, &n3, &n4, &n5, &n6); ...what ends up happening is that it reads the first line in the file twice without continuing down to the second line. is there some sort of flag or identifier i need to set in order to ensure that the fileptr doesn't reset to the beginning? might i be accidentally resetting the fileptr (though i only use it in fopen, fclose, fscanf) inadvertently? any help would be greatly appreciated, thanks again... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|