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?
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*
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.