I would like to read in a file of the form:
1 2 1
1 3 1
1 4 1
2 1 1
2 4 1
and store the int in the right hand column in the two dimensional array at array[i][j] where i is obviously the first entry of a line and j the second.
My approach presently is to use fgets and read in line by line, obtaining a char and then hop through it, doing atoi on the fields seperated by white space.
Is this implementation plausible? I have found a panoply of functions beginning with f (hence ffunctions - a terrible joke I know) for working with files and get the feeling that there may be a slicker implementation.