Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

deep copy c++

//SHALLOW COPY
class X
{
private:
    int i;
    int *pi;
public:
    X()
        : pi(new int)
    { }
    X(const X& copy)   // <-- copy ctor
        : i(copy.i), pi(copy.pi)
    { }
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #deep #copy
ADD COMMENT
Topic
Name
1+9 =