Tạo Trắc Nghiệm

700+ câu trắc nghiệm Ngôn ngữ lập trình C có đáp án - Phần 18

25 câu · Đề ôn tập tổng hợp

Xem trước: đọc nhanh mọi câu dạng chữ, chưa tính giờ, chưa hiện đáp án.
Luyện tập: chọn đáp án là biết đúng sai ngay, kèm lời giải.
Thi thử: nộp bài mới chấm điểm và hiện lời giải.

Câu 1

It is not necessary to initialize a reference to real object when it is declared.

Đáp án và lời giải

Đáp án: B

Câu 2

There can be a null reference.

Đáp án và lời giải

Đáp án: B

Câu 3

One can reassign reference after it is initialized.

Đáp án và lời giải

Đáp án: B

Câu 4

It is nothing wrong that a function returning a reference to an automatic variable.

Đáp án và lời giải

Đáp án: B

Câu 5

One can apply pointer arithmetic with reference variables.

Đáp án và lời giải

Đáp án: B

Câu 6

The preprocessor processes source code before the compiler does.

Đáp án và lời giải

Đáp án: A

Câu 7

A class is a basic unit of object-oriented programming.

Đáp án và lời giải

Đáp án: B

Câu 8

A function template defines a parameterized nonmember function, which enables a program to call the same function with different types of arguments.

Đáp án và lời giải

Đáp án: A

Câu 9

Destructors can be overloaded.

Đáp án và lời giải

Đáp án: B

Câu 10

Static data members cannot be private.

Đáp án và lời giải

Đáp án: B

Câu 11

Static member functions can use this pointer.

Đáp án và lời giải

Đáp án: B

Câu 12

One cannot use enumerations in a class.

Đáp án và lời giải

Đáp án: A

Câu 13

One cannot create an object of a virtual class.

Đáp án và lời giải

Đáp án: B

Câu 14

A class that builds a linked list should destroy the list in the class destructor.

Đáp án và lời giải

Đáp án: A

Câu 15

Once an exception has been thrown, it is not possible for the program to jump back to the throw point.

Đáp án và lời giải

Đáp án: A

Câu 16

In C++, only one catch block can handle all the exceptions.

Đáp án và lời giải

Đáp án: A

Câu 17

There can be only one catch block in a program.

Đáp án và lời giải

Đáp án: B

Câu 18

When an exception if throw, but not caught, the program ignores the error.

Đáp án và lời giải

Đáp án: B

Câu 19

A class object passed to a function template must overload any operators used on the class object by the template.

Đáp án và lời giải

Đáp án: A

Câu 20

In the function template definition it is not necessary to use each type parameter declared in the template prefix.

Đáp án và lời giải

Đáp án: B

Câu 21

It is possible to overload a function template and an ordinary (non-template) function.

Đáp án và lời giải

Đáp án: A

Câu 22

A class template may not be used as a base class.

Đáp án và lời giải

Đáp án: B

Câu 23

When declaring an iterator from the STL, the compiler automatically creates the right kind, depending upon the container it is used with.

Đáp án và lời giải

Đáp án: A

Câu 24

‘ios’ stream is derived from iostream.

Đáp án và lời giải

Đáp án: B

Câu 25

What is the output of the following code? #include using namespace std; int main() { int a = 20; int &n = a; n = a++; a = n++; cout << a << "," << n << endl; system("pause"); }

Đáp án và lời giải

Đáp án: D