I have a .txt file containing 100 integers all on one line, each integer separated by a space. This is the code I have made to read this file and print the integers from it
What I am now trying to do is to generalise this code to read from files of arbitrary length. I am thinking I need to count the elements in the file then use that number to set the size of the array filecontents[]. Not sure though, any advice welcome.