[ create a new paste ] login | about

Link: http://codepad.org/l3utNNHu    [ raw code | output | fork ]

C++, pasted on Dec 31:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// mwhaa.cpp

#include <iostream>
#include <vector>

int main() {
    std::vector<int> vec;
    int howBig = 5; // How big you wish vec to be.

    for(int i = 0; i <= howBig; i++) {
        vec.push_back(i);
    }

    for(int j = 0; j < vec.size(); j++) {
        std::cout << vec[j] << " ";
    }

    return 0;
}


Output:
1
2
3
cc1plus: warnings being treated as errors
In function 'int main()':
Line 14: warning: comparison between signed and unsigned integer expressions


Create a new paste based on this one


Comments: