Home
Current Affairs January 2024

What is the correct answer?

4

When one object initializes another object the following function is invoked

A. copy constructor

B. new

C. instantiation

D. none of the above

Correct Answer :

A. copy constructor


Related Questions

What is the correct answer?

4

The members of a class can be made private by

A. declaring them private

B. by default they are private

C. by declaring them in the beginning of the program immediately after main()

D. they are always public

What is the correct answer?

4

Which of the following can legitimately be passed to a function?

A. A constant

B. A variable

C. A structure

D. A header file

What is the correct answer?

4

An object is an allocated space in memory.

A. True

B. False

What is the correct answer?

4

_____________ operator must have one class object

A. +

B. new

C. all

D. None of these

What is the correct answer?

4

Scope resolution operator has the highest precedence.

A. True

B. False

What is the correct answer?

4

Which of the following is true about const member functions?

A. const members can be invoked on both const as well as nonconst objects

B. const members can be invoked only on const objects and not on nonconst objects

C. nonconst members can be invoked on const objects as well as nonconst objects

D. none of the above

What is the correct answer?

4

A destructor can have arguments like constructor.

A. True

B. False

What is the correct answer?

4

Data objects can be initialized when allocating memory using 'new'.

A. True

B. False

What is the correct answer?

4

Inline function specifier reduces the overheads associated with a normal function call.

A. True

B. False

What is the correct answer?

4

Dynamic memory can be allocated by the following declaration

A. new

B. volatile

C. static

D. ==

What is the correct answer?

4

When you overload an arithmetic assignment operator, the result

A. Goes in the object to the right of the operator

B. Goes in the object to the left of the operator

C. Goes in the object of which the operator is a member

D. Must be returned

What is the correct answer?

4

cc ___________ option is used only to create object file

A. -a

B. -o

C. -c

D. none of these

What is the correct answer?

4

The library function exit() causes an exit from

A. The loop in which it occurs

B. The block in which it occurs

C. The function in which it occurs

D. The program in which it occurs

What is the correct answer?

4

Overloaded functions

A. Are a group of functions with the same name

B. All have the same number and types of arguments

C. Make life simpler for programmer

D. May fail unexpectedly due to stress

What is the correct answer?

4

A member function can always access the data

A. In the object of which it is a member

B. In the class of which it is a member

C. In the object of the class of which it is a member

D. In the public part of its class

What is the correct answer?

4

ios containes a pointer to streambuf.

A. True

B. False

What is the correct answer?

4

Sharing of common information are achieved by the concept of

A. Virtual copying

B. Inheritance

C. Encapsulation

D. None of these

What is the correct answer?

4

Class is similar to a variable.

A. True

B. False

What is the correct answer?

4

The following syntax is valid. void inline gram_ panchayat :: show_gram_ panchayat_info().

A. True

B. False

What is the correct answer?

4

A copy constructor is used to copy an object member wise to another object of the same class.

A. True

B. False

What is the correct answer?

4

The new operator always returns a void pointer.

A. True

B. False

What is the correct answer?

4

What is the output of the following program segment - for(i = 1, j = 0; i < 10; i++) j += i; cout <<i<<"
";

A. 10

B. 20

C. 55

D. there is an error in the program

What is the correct answer?

4

Protected data members can be accessed

A. Only from the base class itself

B. Both form the base class and from its derived classes

C. From the class which is friend of the base class

D. None of the above are correct

What is the correct answer?

4

this' is an implicit pointer.

A. True

B. False

What is the correct answer?

4

We cannot have the address of a constructor.

A. True

B. False

What is the correct answer?

4

_______ argument(s) are passed in case of unary overloaded operators.

A. Two

B. One

C. No

D. None of the above

What is the correct answer?

4

iostream is inheried from istream, ostream and ios class.

A. True

B. False

What is the correct answer?

4

What is the value of Friday in the following - enum days { Monday, Tuesday, Wednesday = -1, Thursday, Friday, Saturday = 6, Sunday}

A. 1

B. 5

C. 0

D. -3

What is the correct answer?

4

The string table in C++ holds the

A. string constants in your program

B. program statements in string form

C. variables whose type is of string

D. none of the above

What is the correct answer?

4

Static data member can be declared as const too.

A. True

B. False