[ create a new paste ] login | about

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

johannes - C++, pasted on Nov 2:
#include <iostream>

int main()
{
    int *p[2];

    int *a = new int;
    *a = 21;
    int *b = new int;
    *b = 22;

    p[0] = a;
    p[1] = b;

    std::cout << *p[0] << std::endl;          // 21
    std::cout << *p[1] << std::endl;          // 22

    delete a;
    delete b;

    return 0;
}


Output:
1
2
21
22


Create a new paste based on this one


Comments: