OOP2023_P1_B11B12_March27

OOP2023_P1_B11B12_March27

University

5 Qs

quiz-placeholder

Similar activities

Quiz 8: Arrays&Vector

Quiz 8: Arrays&Vector

University

10 Qs

C++ Assessment

C++ Assessment

University

10 Qs

OOP2023_B11B12Quiz_April24

OOP2023_B11B12Quiz_April24

University

5 Qs

PPS MCQ on 22.11.2024

PPS MCQ on 22.11.2024

10th Grade - University

6 Qs

Quiz 4

Quiz 4

University

5 Qs

Array in C

Array in C

University

10 Qs

Estilo de Código en Java

Estilo de Código en Java

University

10 Qs

 2D Arrays  C Programming 25ec204

2D Arrays C Programming 25ec204

University

10 Qs

OOP2023_P1_B11B12_March27

OOP2023_P1_B11B12_March27

Assessment

Quiz

Computers

University

Hard

Created by

MR ARORA

Used 1+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following statements about the this pointer is false?

The this pointer is a keyword in C++ that refers to the object that is currently being operated on.

The this pointer can be used to access member variables and member functions of the current object.

The this pointer is not a constant pointer and can be reassigned to point to a different object.

The this pointer is automatically passed as a hidden argument to all non-static member functions.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following code snippets correctly uses new and delete to allocate and deallocate a dynamic array of pointers with a size of 5?

int *arr = new int[5];

delete[] arr;

int *arr = new int*[5];

delete[] arr;

int *arr = new int*[5];

delete[] *arr;

int *arr = new int[5]();

delete[] arr;

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Predict the output of the given code.

1 and 3

Run time error

10 and 2

Compile time error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Predict the output of the given code.

Default constructor called.

Parameterized constructor called with 42.

Destructor called.

Destructor called.

Default constructor called.

Parameterized constructor called with 42.

Destructor called.

Default constructor called.

Destructor called.

Default constructor called.

Destructor called.

Default constructor called.

Destructor called.

Parameterized constructor called with 42.

Destructor called.

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is true about friend functions in C++?

They can be called only from within the class

They cannot be overloaded

They can be defined in the class or outside the class

They can be inherited by derived classes