I have a file called file.dat and have to write a program called sdev.c which adds up all of the numbers in file.dat from each line. (Assuming that one number is per line)
which has to open like this
$ ./sdev < file.dat
Now I can do all of the work that adds up the numbers but how the hack can I open it and scan each number from each line?