how do u initialize the constant variables
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / bibin joy
class A
{
const int mConstVal ;
A():mConstVal (10)
{
}
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / yughandhar
as for my knowledge,the constant variables are intialised by
keyword called DEFINE
Eg:
#define pie=3.14
| Is This Answer Correct ? | 4 Yes | 7 No |
Why is polymorphism used?
why the argument is passed by reference to a copy constructor?example?
What is the difference between a mixin and inheritance?
What does it mean when someone says I oop?
why to use template classes in c++?
What is oops in programming?
What is the difference between the c++ & java?
What does and I oop mean in text?
what is overloading
what is SPL in c++.
Why polymorphism is used in oops?
hi all..i want to know oops concepts clearly can any1 explain??