How do you initialize a class member,
class x {
const int i;
};
Answer Posted / gayatri
using constructor we can initialize a class member in public
part of class.
class x
{
private: int i;
public: x()
{
i = 10;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is c++ pass by reference or value?
What is c++ similar to?
Is nan a c++?
What is the operator in c++?
Search for: what is pair in c++?
What is a container class?
What is the use of 'this' pointer?
What's the best free c++ profiler for windows?
What is atoi?
Describe the process of creation and destruction of a derived class object?
What is c++ try block?
What is a container class? What are the types of container classes in c++?
Do you know what are pure virtual functions?
What are manipulators in c++ with example?
What is time h in c++?