MCQOPTIONS
Bookmark
Saved Bookmarks
→
Computer Science Engineering (CSE)
→
Software Design Modeling in Computer Science Engineering (CSE)
→
The following is the C++ style comment..
1.
The following is the C++ style comment
A.
//
B.
/*..*/
C.
–
D.
none of above
Answer» B. /*..*/
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
#include<iostream> using namespace std; class X { public: int x; }; int main() { X a = {10}; X b = a; cout <<a.x <<" " <<b.x; return 0; }
#include<iostream> using namespace std; class Point { public: Point() { cout <<"Constructor called"; } }; int main() { Point t1, *t2; return 0; }
Output of following program? #include<iostream> using namespace std; class Point { Point() { cout <<"Constructor called"; } }; int main() { Point t1; return 0; }
When a copy constructor may be called?
Which of the followings is/are automatically added to every class, if we do not write our own.
Is it fine to call delete twice for a pointer? #include<iostream> using namespace std; int main() { int *ptr = new int; delete ptr; delete ptr; return 0; }
What happens when delete is used for a NULL pointer? int *ptr = NULL; delete ptr;
Predict the output? #include <iostream> using namespace std; class Test { int x; Test() { x = 5;} }; int main() { Test *t = new Test; cout <<t->x; }
Which of the following is true about new when compared with malloc. 1) new is an operator, malloc is a function 2) new calls constructor, malloc doesn't 3) new returns appropriate pointer, malloc returns void * and pointer needs to typecast to appropriate type.
Which of the following is true about the following program #include <iostream> class Test { public: int i; void get(); }; void Test::get() { std::cout <<"Enter the value of i: "; std::cin >>i; } Test t; // Global object int main() { Test t; // local object t.get(); std::cout <<"value of i in local t: "<<t.i<<'\n'; ::t.get(); std::cout <<"value of i in global t: "<<::t.i<<'\n'; return 0; }
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply