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 u initialize the constant variables

Answer Posted / keshav.gadde

class sam
{
const int x;
public:
sam(int i):x(i)
{
cout<<i<<endl;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
sam s(10);
return 0;
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between inheritance and polymorphism?

1103


Why do we use inheritance?

1111


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

4921


What is protected in oop?

1066


What are the two different types of polymorphism?

1141


• What are the desirable attributes for memory managment?

2225


Why do we use oop?

1094


What is inheritance write a program to show use of inheritance?

1142


Can a varargs method be overloaded?

1093


What is oops with example?

1044


What is multilevel inheritance explain with example?

1139


Why do while loop is used?

1026


Can we have inheritance without polymorphism?

1019


2. Give the different notations for the class.\

2153


Can main method override?

1104