Search:

Type: Posts; User: james890

Search: Search took 0.00 seconds.

  1. Resolved

    I've sorted it.


    while(datFile >> Val)
    {
    if (Val > n)
    {
    n = Val;
    }
    }
  2. I'm not sure I understand what your suggesting to...

    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...
  3. Ok, I've tried this: while(!datFile.eof() )...

    Ok, I've tried this:


    while(!datFile.eof() )
    {
    datFile >> Val;
    n = Val;
    if (Val > n)
    n = Val;
    }
  4. Ah, I think I know what you mean. I just wasn't...

    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...
  5. I'm not familiar with the overload operator. I'm...

    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...
  6. Read max value from strings of numbers in text file

    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......
    ...........
    ......
Results 1 to 6 of 6