[ create a new paste ] login | about

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

C++, pasted on Feb 10:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int vals[] = {1,2,3,4,5,6,7,8,9};
    vector<int> vec(vals, vals+9);

    vector<int>::iterator i = vec.end();
    while(i != vec.begin())
    {
        --i;
        cout << *i << endl;
    }
}


Output:
1
2
3
4
5
6
7
8
9
9
8
7
6
5
4
3
2
1


Create a new paste based on this one


Comments: