[ create a new paste ] login | about

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

C++, pasted on Nov 21:
#include <iostream>

using namespace std;


int main()
{
    int a=3,*ptr;

    ptr=new int;
    cout<<&ptr<<endl;
    cout<<ptr<<endl;
    cout<<*ptr<<endl;
    delete ptr;
    endl(cout);

    ptr=new int(6);
    cout<<&ptr<<endl;
    cout<<ptr<<endl;
    cout<<*ptr<<endl;

    endl(cout);
    ptr=&a;
    cout<<&ptr<<endl;
    cout<<ptr<<endl;
    cout<<*ptr<<endl;

    return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
0xbf789234
0x8050438
-1819044973

0xbf789234
0x8050438
6

0xbf789234
0xbf789238
3


Create a new paste based on this one


Comments: