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 |
When not to use object oriented programming?
write a program to find 2^n+1 ?
can we make game by using c
write a program that takes input in digits and display the result in words from 1 to 1000
How Do you Code Composition and Aggregation in C++ ?
write a c++ program to find maximum of two numbers using inline functions.
what is polymorpsim? what are its types?
Get me a number puzzle game-program
What are functions in oop?
what is the difference between class to class type conversion and copy constructor ?
What do you mean by inheritance?
wht is ditch