How do you initialize a class member,
class x {
const int i;
};
Answer Posted / harminder
It can be done in the intialization list of the constructor
x():i=10
{
}
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Describe the process of creation and destruction of a derived class object?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
What is array in c++ pdf?
What is data binding in c++?
Should I learn c or c++ or c#?
Why was c++ created?
What is dynamic and static typing?
What does it mean to declare a member function as virtual?
Which software is best for coding?
What's the "software peter principleā?
What is the use of 'this' pointer?
What are the characteristics of friend functions?
Write a recursive program to calculate factorial in c++.
Can I uninstall microsoft c++ redistributable?
What is problem with overriding functions?