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
Which software is best for c++ programming?
Write a program to add three numbers in C++ utilizing classes.
How do you flush a buffer in c++?
Explain the problem with overriding functions
What do you mean by early binding?
What is increment operator in c++?
Can you use the function fprintf() to display the output on the screen?
What is the use of lambda in c++?
Do inline functions improve performance?
What is the difference between #import and #include?
How static variables and local variablesare similar and dissimilar?
What does it mean to declare a member function as static?
What is the use of bit fields in structure declaration?
Evaulate: 22%5 a) 2 b) 4 c) 0
What are pointers used for c++?