i cant see everything in my console window

When I run this program I can only see the last 250 lines. Anyone know why? I'm running windows 7.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
#include <vector>
#include <list>
#include <deque>
#include <stdlib.h>
#include <time.h>

using namespace std;

int main()
{
    vector<int> num;

    srand((unsigned)time(0));

    int counter = 0;
    int NumElements = (rand()% 10000) + 1;
    int RandomNumber = 0;

    while(counter != NumElements)
    {
        RandomNumber = (rand()% 10000) + 1;

        num.push_back(RandomNumber);

        counter++;
    }

    cout << "The vector has " << num.size() << " Elements" << endl;

    cout << endl << endl << endl << endl << endl;

    while(counter != -1)
    {
        cout << "Element " << counter << " has " << num[counter] << " in it" << endl;

        counter--;
    }

    return 0;
}
This is not a C++ problem; it's because your console buffer isn't long enough. Have a poke at the console options and find the one that controls its buffer size.
I knew it wasn't a code problem I just knew someone would know here :) what number do I change it to? is it options - command history - buffer size and number of buffers or layout - screen buffer size - width and height.
Last edited on
If you just care about visualization, you could try pipe or redirect to a file
1
2
$ ./program.bin | more
$ ./program.bin > file
Topic archived. No new replies allowed.