views:

85

answers:

3

suppose that MyClass has methods with the following prototypes:

void method1(MyClass & object1);  

MyClass * method 7(); 

What will be this method destructor, constructor, copy constructor, overloaded= or default constructor?

This is one of question in my homework.

I think the first one is default constructor and second one is copy constructor but not sure about it. I know that these methods are not destructor for sure so need help with this.

A: 

Neither of those methods will be any of the options in the question. The question is really asking "How do all these things (destructor, constructor, etc.) get into the class?" All C++ classes will have them. Where do they come from, and what will they look like?

Tim Yates
No I think you are taking it differently.
cool
A: 

You can find examples and information about each of those methods by searching Google for phrases like "C++ constructor" or "C++ copy constructor." That should lead you to plenty of educational resources that will help you be able to answer your question.

Josh Petrie
Ok I will do that.
cool
A: 

See the section on "Constructors and Destructors".

dublev
Apparently today I got the answer from my professor and above two methods are nothing. It was trick.
cool