> Is there anyway to make another isntance of an object by using another
> objects pointer as a base?
>
> So I mean like if I have:
>
> CObject *ob1 = new Object(blah,blah,blah,blah);
>
> and then I want ob2 to be exactly the same as ob2, is it possable just to
> copy ob1? (i.e. dont need to write everything out).
>
> I tried just doing
> CObject *ob2 = ob1, but then ob2 is actually ob1 and you end up with two
> pointers to one object and not two pointers to two objetcs

That depends on how your copy constructor is set up.  There are deep copies and
shallow copies (they don't do the same thing).  Take a look at a good book on
C++ (I recommend Stroustrup's ARM, annotated reference manual).  Look up "copy
constructor" in the index for a detailed explanation.

Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to