Which of the following member functions can be used to add an element in an std::vector?
Correct Answer: push_back
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
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; }
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?
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?
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?
Output of the code? class Shape { public: virtual void draw() = 0; }; class Rectangle: public Shape { public: void draw() { // Code to draw rectangle } //Some more member functions..... }; class Circle : public Shape { public: void draw() { // Code to draw circle } //Some more member functions..... }; int main() { Shape objShape; objShape.draw(); } What happens if the above program is compiled and executed?
____ consists of 65,536 characters.
Subscript numbering in c++________.
Every complete c++ program must have a __________.
An element of a two-dimensional array is referred to by ________ followed by ________.
An array with no elements is ________.