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 / gayatri

using constructor we can initialize a class member in public
part of class.

class x
{
private: int i;

public: x()
{
i = 10;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the setting up of my member functions to avoid overriding by the derived class?

1193


Is it possible for a member function to delete the pointer, named this?

1240


What is #include cmath?

1144


What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)

1096


Is c++ a high level language?

1050


Which software is best for coding?

1099


What is rtti in c++?

1183


What are the differences between java and c++?

1129


What does scope resolution operator do?

1164


What are the advantages of early binding?

1117


Why ctype h is used in c++?

992


What are the different types of comments allowed in c++?

1026


What is the use of setfill in c++?

1122


What do you mean by const correctness?

1135


Why are pointers not used in c++?

1190