What are "items"? If they're all of the same type, like integers, you can declare the array like so:
Then just read the file like you normally do and assign to each index in the array:Code:int file[100];
Code:/* Gather numbers from the file */ for ( i = 0; i < 100; i++ ) { if ( fscanf ( in, "%d", &file[i] ) != 1 ) break; } /* Display gathered numbers */ for ( j = 0; j < i; j++ ) printf ( "%d\n", file[j] );