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

daily Routine of father

1408


What is the use of pointer in c++ with example?

1040


What is tellg () in c++?

1303


Is c++ primer good for beginners?

1040


What is a catch statement?

1045


What is the role of C++ shorthand's?

1274


What is the v-ptr?

1161


Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?

2512


Which software is best for programming?

1152


What is expression parser in c++

2495


Explain virtual destructor?

1190


What is c++ array?

1116


What is near, far and huge pointers? How many bytes are occupied by them?

1117


What is object in c++ example?

1106


what is C++ exceptional handling?

1171