View Single Post
Old 09-25-2002, 12:01 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
strtok(), search for the whiutespaces in the lines, that counts the columns..

Or while reading, something like this:
Code:
int read = 0;
int a, b, c;
read = fscanf(file_pointer, "%d %d %d\n", &a, &b, &c);
if(read < 3)
   // error happened, or line didnt hold three integers.
else
   // success, we have our line, with three or more columns.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote