Correct Answer: Illegal in C++
Explanation:
Note: This Question is unanswered, help us to find answer for this one
C++ Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More C++ MCQ Questions
An element of a two-dimensional array is referred to by ________ followed by ________.
Every complete c++ program must have a __________.
Subscript numbering in c++________.
____ consists of 65,536 characters.
________ are c++ operators that change their operands by one.
Answer the question that follows. class Outer { public: class Inner { int Count; public: Inner(){}; }; }; int main() { Inner innerObject; Outer outObject; return 0; } What will be the result when the above code is compiled?
Answer the question that follows. class Person { public: Person(); virtual ~Person(); }; class Student : public Person { public: Student(); ~Student(); }; main() { Person *p = new Student(); delete p; } Why is the keyword 'virtual' added before the Person destructor?
Consider the following code: #include using namespace std; class A { public: A() { cout << 'Constructor of A\n'; }; ~A() { cout << 'Destructor of A\n'; }; }; class B { public: B() { cout << 'Constructor of B\n'; }; ~B() { cout << 'Destructor of B\n'; }; }; class C { public: A objA; B objB; }; int main() { C *pC; pC = new C(); delete pC; return 0; } What will be the printed output?
Output of the following code? #include using namespace std; class myclass { private: int number; public: myclass() { number = 2; } int &a() { return number; } }; int main() { myclass m1,m2; m1.a() = 5; m2.a() = m1.a(); cout << m2.a(); return 0; }
Which member functions can be used to add an element in an std::vector?