the big 3

hi, i am new to c++(4months) and would like to ask about the big 3(operator assignment, destructor and copy constructor)
1)Do we usually use this big 3 when they involve a *pointer as an attribute?
2)Is it possible to use an array(of pointers) or dynamic array(of pointers)?
3)Athlete** list <-- can anyone please explain this?
4)How do I convert a string into an objects? like eg reading from a file,how should the format of the file be like?

Thank guys
1. For me I have to call destructor everytime I use pointer, so maybe yes.
2. Sure, you can. there're int**, char**, etc.
3.I assume that Athlete is a class or struct you created. So Athlete** list is creating a pointer to pointer of Athlete class/struct, can be both 2-D array of Athlete or an array of pointer to Athlete(Array is also pointer, if you know). (This is one example of your 2nd question?)
4. What's an Object you said about? There're many types of object, no specific.
When you read from file, there're 2 ways as basic. String and Stream, and as I know they can switch by Stream << String or String = Stream.str().

All answered in the way I do, so maybe different from others *w*
Last edited on
To add to what is above...

1. Yes, if the object is responsible for the memory addressed by the pointer. Google around "shallow vs deep copy" for more.

4. This is a broad topic, and one of the most difficult things to do in C++. Google "object serialization" for more.

Hope this helps.
2. You could use horrible nasty C-Style implementations but I would recommend c++ stl containers over these any day. For example std::list and std::vector.
Thanks for your replies I will do some research #soulsearching :)
Topic archived. No new replies allowed.