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 private, protected and public?

1076


What are built-in functions? What is the syntax for the definition?

1079


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

1129


What is the benefit of encapsulation?

1074


Is map ordered c++?

1089


What does iomanip mean in c++?

1198


What happens when you make call 'delete this;'?

1085


How do we balance an AVL Tree in C++?

1128


Define a nested class. Explain how it can be useful.

1081


How to declaring variables in c++?

1155


Explain what happens when a pointer is deleted twice?

1252


Do the parentheses after the type name make a difference with new?

1083


What are keywords in c++?

1095


Is c# written in c++?

981


Why c++ is faster than java?

1056