Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do you initialize a class member,
class x {
const int i;
};

Answer Posted / harminder

It can be done in the intialization list of the constructor

x():i=10
{
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the process of creation and destruction of a derived class object?

1171


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

1064


What is array in c++ pdf?

1284


What is data binding in c++?

1006


Should I learn c or c++ or c#?

1053


Why was c++ created?

1084


What is dynamic and static typing?

1251


What does it mean to declare a member function as virtual?

1118


Which software is best for coding?

1099


What's the "software peter principleā€?

1194


What is the use of 'this' pointer?

1299


What are the characteristics of friend functions?

1073


Write a recursive program to calculate factorial in c++.

1141


Can I uninstall microsoft c++ redistributable?

1187


What is problem with overriding functions?

1117