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

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
Get step-by-step solutions from verified subject matter experts
