Question: trying to store numbers into an array numbers like {6,5,8 7,9,8 3,4,2} im reading the numbers from a file and want to store each row

trying to store numbers into an array numbers like {6,5,8
7,9,8
3,4,2}
im reading the numbers from a file and want to store each row in an array. ex: so array1={6,7,3}
array2={5,9,4}
array3={8,8,2}
but i want it to work for any size array with any numbers.
 trying to store numbers into an array numbers like {6,5,8 7,9,8

for (c = getc(fp_1); c != EOF; C = getc(fp_1)), if (c == ' ') // Increment count if this character is newling | count = count + 1; printf("The file has %d lines ", count); int end_1 [count]; int end_2[count]; int weight(count); if (fseek(fp_1, OL, SEEK_SET) != 0 ) /* Handle repositioning error */ printf("%s ", "Did something wrong "); while(fscanf(fp_1, "%d", &num) > 0), end_1[i] = num; printf("%d ", end_1[0]); //vertices i++; for(fscanf(fp_1, "%d", &num > 0)); end_2[i] = num; i++; fscanf(fp_1, "%d", &num); weight[i] = num; i++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!