I need to find the sum of all numbers in a file. I read in the file, but how do i save all the numbers and then add them? Thanks guy/gals.
Code:void sumofnum (int input) { FILE* spData; int var; spData = fopen ("lab7a.txt", "r"); if (input == 2) { fscanf (spData, "%d", &var) // Im stuck here } return; }