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

Which one is better- macro or function?

1123


Differentiate between a constructor and a destructor in c++.

969


What are shallow and deep copy?

1044


Can a constructor be private?

1024


What is doubly linked list in c++?

1028


Why can templates only be implemented in the header file?

1060


Give an example of run-time polymorphism/virtual functions.

949


How to access a variable of the structure?

1015


Can we declare a base-class destructor as virtual?

959


what is pre-processor in C++?

1090


Differentiate between late binding and early binding.

1199


What are punctuators in c++?

1088


How can we read/write Structures from/to data files?

1064


By using c++ with an example describe linked list?

980


How we can differentiate between a pre and post increment operators during overloading?

1041