I know the code is horrible and I'm sorry for that. I'm new to programming. I'm trying to read in a list of numbers like this:
3 3 15
123 5 4 3
124 2 5 5
125 3 5 2
It successfully opens the file, but I can't get it to read in the numbers. I'm trying to avoid multi-dimensional arrays. Any help would be greatly appreciated.
I actually want to read it in one line at a time. I added the code below and it now reads in the whole file, except the last line, but I want to read in one line at a time and break that down into an array with it able to identify separate parts, for example,
line one:
cout << array[0] << endl; with the first number being displayed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
string line;
lineCount = 0;
getline(ins, line);
while (!ins.eof())
{
lineCount++;
cout << line << endl;
getline (ins,line);
}