Can a constructor return a value?
Answer / nashiinformaticssolutions
It is possible for a constructor to return a value. A constructor cannot explicitly return a value; instead, it implicitly replaces the current instance of the class.
| Is This Answer Correct ? | 0 Yes | 0 No |
class X { public: int x; static void f(int z); }; void X::f(int y) {x=y;} What is the error in the sample code above? a) The class X does not have any protected members. b) The static member function f() accesses the non-static z. c) The static member function f() accesses the non-static x. d) The member function f() must return a value. e) The class X does not have any private members.
Write a C++ Program to Multiply two Numbers
What are the advantages of using typedef in a program?
why the size of an empty class is 1
What is a storage class? Mention the storage classes in c++.
What is a node class?
why all c++ program must have default constructor?
What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?
What does it mean to declare a member variable as static?
Do we have to use initialization list in spite of the assignment in constructors?
Do class declarations end with a semicolon?
What is the keyword auto for?