I've sorted it.
while(datFile >> Val)
{
if (Val > n)
{
n = Val;
}
}
Type: Posts; User: james890
I've sorted it.
while(datFile >> Val)
{
if (Val > n)
{
n = Val;
}
}
I'm not sure I understand what your suggesting to do...
Should I try to calculate both numbers in the same while loop?
Are you telling me how to calculate 'n'?
Sorry for my probably stupid...
Ok, I've tried this:
while(!datFile.eof() )
{
datFile >> Val;
n = Val;
if (Val > n)
n = Val;
}
Ah, I think I know what you mean. I just wasn't aware it was called the overloaded operator. But it will not be able to differentiate between numbers will it, because it is just a text file. Don't I...
I'm not familiar with the overload operator. I'm a beginner. How do I use it?
All lines in the code are just numbers, nothing more. Like I put in my post.
So first few lines could be:
1 3 5 9...
Hi folks.
I have a text file with a thousands of rows of numbers in it.
For example:
1 2 4 6 11 13 19 21 66 97 101 ........
1 3 9 12 18 26 44 56 98 113......
...........
......