FILE *pFile;
pFile = fopen("address01", "r");
int yup[8];
int* array[7];
for (int i = 0;i < 7; i++) {
while (!feof(pFile)) {
fgets(yup, 8, pFile);
puts(yup); //It DOES print each line
array[i] = yup;
}
}
fclose(pFile);
printf("First: %d",array[0]); //I want it to print the first thing in the file, but I get a
//crazy number. It should be 10.
printf("Second: %d",array[1]); //I want it to print the 2nd thing in the file, but I get a
//crazy number. It should be 20
//etc.
Essentially, I want to be able to select any number in my array for later manipulation.
Contents of address01:
10
20
22
18
E10
210
12