All pastes #1650312 Raw Edit

Ralph

public cpp v1 · immutable
#1650312 ·published 2009-10-31 10:41 UTC
rendered paste body
#include <iostream>using namespace std;class A{public :	int foo;	A(){		cout<<"A ctor called"<<endl;		}		~A(){		cout<<"A dtor called"<<endl;		}		void f(){		cout<<"f called"<<endl;	}	};class B : public A{public :	B(){		cout<<"B ctor called"<<endl;		}		~B(){		cout<<"B dtor called"<<endl;		}};int main(){	B *c;	c->f();	c->foo=12;}/* OUTPUT :-rahul@kodersbox:~/Desktop/krew$ g++ boo.cpprahul@kodersbox:~/Desktop/krew$ ./a.outf calledSegmentation fault*/