[ create a new paste ] login | about

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

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

class C {
public:
  C() { cout << "default constuctor" << endl; }
  C(int x) { cout << "int constuctor" << endl; }
  C &operator=(int x) { cout << "int assignment" << endl; return *this; }
};

int main() {
  C a = 0;
  C b;
  b = 1;
}


Output:
1
2
3
int constuctor
default constuctor
int assignment


Create a new paste based on this one


Comments: