05-02-2011, 06:28 PM
why we use member intilizer list.what is benefit of using it.
|
why we use member intilizer list.what is benefit of using it.
|
|
05-02-2011, 06:28 PM
why we use member intilizer list.what is benefit of using it.
05-02-2011, 06:29 PM
A proper initialization of data member has a special syntactic construct called a member initialization list.
For example: class Person { //.. public: //member initialization list: Person(int a, const string & n) : age (a), name (n) {} }; A member initialization list is the primary form of initializing data members of an object. In some cases, initialization is optional. However, const members, references and sub objects whose constructors take arguments necessitate a member initialization list. 0300-9520262 Get solution in 24 hour |cpmputer & internet mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
|
|
« Next Oldest | Next Newest »
|