Thread: how to see all the values???HELP!!!

  1. #1
    Whats gonna happen now! himanch's Avatar
    Join Date
    Feb 2005
    Location
    Armenia
    Posts
    26

    how to see all the values???HELP!!!

    How am i gonna see all the values that are being displayed when i complie the script and run it!!!!i mean when i run it there are about 20 values that are being seen but the others dissapears namely stay up the screen and since there is rolling bar i cannot see them!!!

    #
    Code:
    include <iostream>
    
    using namespace std;
    
    int main()
    {
        int x;
        
        for( x=-65 ; x < 5 ; x++)
        {
             cout<< x <<endl;
             }
             cin.get();
             }
    Hayda!!!Whats gonna happen tomorrow

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    I usually redirect programs which produce lots of output to a file which I then read with an editor
    myprog.exe > results.txt

    Or use a pager to view output a page at a time
    myprog.exe | more
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Whats gonna happen now! himanch's Avatar
    Join Date
    Feb 2005
    Location
    Armenia
    Posts
    26
    but isnt there a way which shows all the values when i run the program???
    Hayda!!!Whats gonna happen tomorrow

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Format them differently. Output them on one line instead of many.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Whats gonna happen now! himanch's Avatar
    Join Date
    Feb 2005
    Location
    Armenia
    Posts
    26
    thkz but how can i output them on the same line?
    Hayda!!!Whats gonna happen tomorrow

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    > thkz but how can i output them on the same line?
    Please stop mushing the spelling by using 'z' all over the place

    Well you could remove the endl from each iteration of the loop, and just do ONE endl when the loop exits.

    But then you'll probably complain that your line is now too long.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed