![]() |
|||||||||||||||||||
|
"exact phrase" include -exclude
will give you more specific results |
Constructor - C++ [1/1]
Constructor function is a special function that is a member of a class and has the same name as that class. For example the figure above shows the stack class when converted to use a constructor function for initialization. You can notice that the constructor stackQ has no return type specified. In C++, constructor functions cannot return values and thus, have no return type. Characteristics of constructer function 1. Should be declared in the public section. 2. Invoked automatically when the objects are created. 3. Do not have return types so cannot return any values. 4. Can have default arguments. 5. Cannot be virtual. 6. Cannot refer to their address. 7. Object with a constructor cannot be used as member of a union. 8. Makes implicit calls to the operator new and delete when memory allocation is required. 9. Cannot be inherited, through a derived class can call the base class constructor.
|
RECOMMENDED TUTORIALS
Need a specific tutorial? Do not hesitate and submit a request! |
|||||||||||||||||
| Related Tags: multiple constructor and copy constructor in c++ what is constructor-c++ WHAT IS A CONSTRUCTOR-C++ using constructor C++ constructor-c++ constructor copy constructor c++ declaring a constructor c++ "c++ copy constructor" ifstream constructor c++ c++ constructor stack C++ multiple constructor delete *this in constructor+C++ parameterized constructor in c++ copy constructor in C++ copy-constructor in c++ characteristics of constructor + c++ copy constructor in c++ parameterised constructor in c++ union constructor c++ | |||||||||||||||||||
|
Home | Sitemap |
Terms & Privacy
© ONLINEHOWTO.net 2006 - 2008 |
|||||||||||||||||||