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 |
if u write a class do u write Assignment operator and copy constructor
define a string class. overload the operator == to compare two strings
2 Answers Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,
How do you define a class in oop?
What is data binding?
What is polymorphism? Explain with an example.
why the argument is passed by reference to a copy constructor?example?
What does oop mean in snapchat?
If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?
What is abstraction in oop?
difine hierarchical inheritance.
What is the difference between static polymorphism and dynamic polymorphism?
When not to use object oriented programming?