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

Will the following program execute?

1002


Are c and c++ different?

943


Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

1409


Explain the difference between new() and malloc() in c++?

1093


the maximum length of a character constant can be a) 2 b) 1 c) 8

1055


Differentiate between a constructor and a method in C++.

1009


What is encapsulation in c++?

1231


What is class invariant in c++?

1190


Why can templates only be implemented in the header file?

1071


What's the best free c++ profiler for windows?

1043


What is binary object model?

980


What is an arraylist c++?

1173


Does c++ have finally?

976


Describe the advantage of an external iterator.

1001


How to give an alternate name to a namespace?

1056