C++ Programming

Test your knowledge of C++ programming fundamentals including object-oriented programming concepts, constructors, unions, function overloading, and operator overloading.

25 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

After you assign a value to reference, you cannot change the reference value.

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

C++ allows you to specify default parameter values to functions. Please state if these statement is true or false?

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

An array variable can be used to different types of data.

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

Unless specified otherwise, C ++ assumes all members of a class as public.

  1. True
  2. False
Question 5 Multiple Choice (Single Answer)

You can define a union variable in C++ without giving it a particular name. State whether the above statement is true or false.

  1. True
  2. False
Question 6 Multiple Choice (Single Answer)

Union definition does not allocate memory.

  1. True
  2. False
Question 7 Multiple Choice (Single Answer)

Each time your program creates a class variable, C++ automatically calls the class constructor function.

  1. True
  2. False
Question 8 Multiple Choice (Single Answer)

Macros execute faster than function calls.

  1. True
  2. False
Question 9 Multiple Choice (Single Answer)

To change the value of a union member within a function, your program must pass the union variable to the function by value.

  1. True
  2. False
Question 10 Multiple Choice (Single Answer)

You cannot overload a constructor function in C++.

  1. True
  2. False
Question 11 Multiple Choice (Single Answer)

Using macros instead of function decreases the size of the executable program.

  1. True
  2. False
Question 12 Multiple Choice (Single Answer)

Constructor & deconstructor functions are generally declared of the type void.

  1. True
  2. False
Question 13 Multiple Choice (Single Answer)

You can overload : (operator ) in C++.

  1. True
  2. False
Question 14 Multiple Choice (Single Answer)

In union, unlike a structure, your programs can only assign a value to one member at a time.

  1. True
  2. False
Question 15 Multiple Choice (Single Answer)

In C++, unless a function uses pointer or references, the function cannot change a parameter's values.

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

In C++, passing structure variable to a function results in compilation error.

  1. True
  2. False
Question 17 Multiple Choice (Single Answer)

In function overloading, the same function operates on different types of data.

  1. True
  2. False
Question 18 Multiple Choice (Single Answer)

Constructor function must always have the same name as the class.

  1. True
  2. False
Question 19 Multiple Choice (Single Answer)

C++ structure consists of one or more pieces of related data of the same type.

  1. True
  2. False
Question 20 Multiple Choice (Single Answer)

You can overload ?: (operator ) in C++. State whether the above statement is True or False.

  1. True
  2. False
Question 21 Multiple Choice (Single Answer)

In C++, if a function follows the functions use, it will not be necessary to place a function prototype at the start of your source file.

  1. True
  2. False
Question 22 Multiple Choice (Single Answer)

To assign a value to or access the value of a structure member, your programs must use the format variable -> member to access a structure.

  1. True
  2. False
Question 23 Multiple Choice (Single Answer)

You cannot pass parameters to a destructor function.

  1. True
  2. False
Question 24 Multiple Choice (Single Answer)

Your program uses the C++ operation keyword to overload an operator.

  1. True
  2. False
Question 25 Multiple Choice (Single Answer)

Constructor function in C++ cannot return a value. Is it true or false?

  1. True
  2. False