[ create a new paste ] login | about

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

C++, pasted on Jul 24:
#include <iostream>

using namespace std;

struct A {
  int x;
};

struct B {
  B() {
    cout << "B()" << endl;
  }
};

int main() {
  int * p1 = new int();
  int * p2 = new int;

  cout << *p1 << endl;
  cout << *p2 << endl;

  A * a1 = new A();
  A * a2 = new A;

  cout << a1->x << endl;
  cout << a2->x << endl;

  new B();
  new B;
}


Output:
1
2
3
4
5
6
0
-1819044973
0
-1819044973
B()
B()


Create a new paste based on this one


Comments: