[ create a new paste ] login | about

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

C++, pasted on May 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <iomanip>

int
main()
{
    const int data[][4] = {
        { -14, 42, 500, -43 },
        { 53, -353, 535, 34 }
    };
    const int (*end)[4] = data + sizeof data/sizeof *data;

    for(const int (*row)[4] = data; row != end; ++row) {
        for(const int* col = *row, *end = *row + 4; col != end; ++col)
            std::cout << std::setw(6) << *col;
        std::cout << '\n';
    }
}


Output:
1
2
   -14    42   500   -43
    53  -353   535    34


Create a new paste based on this one


Comments: