McqMate
Sign In
Hamberger menu
McqMate
Sign in
Sign up
Home
Forum
Search
Ask a Question
Sign In
McqMate Copyright © 2024
→
Computer Science Engineering (CSE)
→
CPP Programming
→
Constructors have _____ return type.
Q.
Constructors have _____ return type.
A.
void
B.
char
C.
int
D.
no
Answer» D. no
3.3k
0
Do you find this helpful?
13
View all MCQs in
CPP Programming
Discussion
No comments yet
Login to comment
Related MCQs
Which of the following is true about constructors? 1) They cannot be virtual. 2) They cannot be private. 3) They are automatically called by new operator.
For automatic objects, constructors and destructors are called each time the objects
Output of the program? #include<iostream> using namespace std; int fun(int x = 0, int y = 0, int z) { return (x + y + z); } int main() { cout << fun(10); return 0; }
Output of following program? #include <iostream> using namespace std; int fun(int=0, int = 0); int main() { cout << fun(5); return 0; } int fun(int x, int y) { return (x+y); }
Implicit return type of a class constructor is:
Return type of uncaught_exception () is ________________.
Output of following program? #include<iostream> using namespace std; class Point { Point() { cout << "Constructor called"; } }; int main() { Point t1; return 0; }
#include<iostream> using namespace std; class Point { public: Point() { cout << "Constructor called"; } }; int main() { Point t1, *t2; return 0; }
Output of following C++ program? #include<iostream> using namespace std; int main() { int x = 10; int& ref = x; ref = 20; cout << "x = " << x << endl ; x = 30; cout << "ref = " << ref << endl; return 0; }
Predict the output of following C++ program. #include<iostream> using namespace std; class Empty {}; int main() { cout << sizeof(Empty); return 0; }