Class and its Member Order

I want to know about class. Does class follow the initializing order? i mean how the function run by order that was inside the class? or it only depends on what the main function is calling from it?

i mean how the function run by order that was inside the class?


no.

or it only depends on what the main function is calling from it?

Yes.

http://www.cplusplus.com/doc/tutorial/classes/

Thank You for that answer.

I have a follow up question.

This is about destructor. Is the destructor needed to be called to initiate or does it need to have a proper location on the class? I have read few about it and still confused.
1) Order of member function in class is unrelevant. You can have destructor declared/defined first, second, last...
2) Order of data members is relevent: they are initialized in order of declaration, no matter what order you have in constructor initializer lists.
3) Destructor destroys data members in reverse order.
Topic archived. No new replies allowed.