[ create a new paste ] login | about

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

C++, pasted on Aug 10:
#include <iostream>
using namespace std;

class cOne{
protected:
	int param;
public:
	cOne(){
		param = 0;
	}
	int data(){
		return param;
	}
};

class cTwo{
protected:
	int param;
public:
	cTwo() : param(0) {}
	int data(){
		return param;
	}
};

int main(){
	cOne one;
	cTwo two;
	cout<<one.data()<<endl;
	cout<<two.data()<<endl;
	return 0;
}


Output:
1
2
0
0


Create a new paste based on this one


Comments: