How do you initialize a class member,
class x {
const int i;
};
Answer Posted / santosh patil
class members can be initialized directly like
class x{const int i=10;}
but its structures members tat cant be initialized lik above
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is meaning of in c++?
What gives the current position of the put pointer?
Why is null pointer used?
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
Is std :: string immutable?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
How new/delete differs from malloc()/free?
What does new in c++ do?
Write about the access privileges in c++ and also mention about its default access level?
Write a program to find the Factorial of a number
How would you use the functions sin(), pow(), sqrt()?
What is the history of c++?
What do you mean by const correctness?