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
How do you define/declare constants in c++?
What do you understand by a pure virtual member function?
What are containers in c++?
Comment on c++ standard exceptions?
Write a program which employs Recursion
What is meaning of in c++?
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
Tell me can a pure virtual function have an implementation?
Is string an object in c++?
What is abstract keyword in c++?
What is the best c c++ compiler for windows?
How do you decide which integer type to use?
Is map ordered c++?
Is there a c++ certification?
Which is best c++ or java?