Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ HALP

Name: Seven 2007-05-11 23:39 ID:Yp9UrS/m

Okey, im a memory noob when it comes to C++, i dunt really understand pointers and shallow-deep copy shit, and its causing me a problem.

Pointer to an image object, is passed to a class which makes some changes and uses it every step/frame. Works fine when theres only one instance of the object, but when i try to create another, my game crashes! Is passing a pointer to multiple instances bad??

Name: Anonymous 2007-05-12 0:49 ID:qDmAthph

>>1
Shallow Copy: If there is no copy constructor, compilers generate code that only copies the actual bits of an object to the new object. This is the default action if you are not wise enough to create your own copy constructor.

Deep Copy: You have a copy constructor and it replicates members of dynamic built-in types and/or calls copy constructors of members of user defined classes and references the copies.

On a side note: if you don't understand pointers, you should stick to flipping... err, Java. 'Nuff said.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List