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

What is pointer in c++ with example?

1077


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

963


In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....

2424


What are manipulators in c++ with example?

1074


what are the iterator and generic algorithms.

2170


Why the usage of pointers in C++ is not recommended ?

1455


Can c++ do everything c can?

1089


What does h mean in maths?

1221


How a modifier is similar to mutator?

1185


What is the use of bit fields in structure declaration?

987


What is c++ 11 and c++ 14?

1057


Explain the difference between struct and class in terms of access modifier.

1182


I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?

2074


Explain terminate() and unexpected() function?

1107


Difference between declaration and definition of a variable.

1169