#include <iostream> class Sample { public: int* p; Sample(int i) { p = new int(i); } Sample(const Sample& pl) { } ~Sample() { delete p; } void print() { std::cout<< "The value is %d" << *p; } }; void fun(Sample s) { std::cout<<"In the fun"; } int _tmain(int argc, _TCHAR* argv[]) { Sample pl = 10; fun(pl); pl.print(); }