[ create a new paste ] login | about

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

C++, pasted on Jul 20:
#include <iostream>
using namespace std;
class CSomeClass
{
    public:
    CSomeClass();
    CSomeClass(const CSomeClass &pCopy);
    friend void SomeFunc1(const CSomeClass  obj);
    friend void SomeFunc2(const CSomeClass &obj);
};

CSomeClass::CSomeClass(){
    cout<<"DEFAULT CONSTRUCTOR"<<endl;
}

CSomeClass::CSomeClass(const CSomeClass &pCopy){
    cout<<"COPY CONSTRUCTOR"<<endl;
}

void SomeFunc1(const CSomeClass  obj){
    cout<<"SomeFunc1"<<endl;
}

void SomeFunc2(const CSomeClass &obj){
    cout<<"SomeFunc2"<<endl;
}

int main()
{
    CSomeClass pObj;
    SomeFunc1(pObj);
    SomeFunc2(pObj);
    return 0;
}
    
    


Output:
1
2
3
4
DEFAULT CONSTRUCTOR
COPY CONSTRUCTOR
SomeFunc1
SomeFunc2


Create a new paste based on this one


Comments: