C++ Programming
Test your knowledge of C++ programming fundamentals including object-oriented programming concepts, constructors, unions, function overloading, and operator overloading.
Questions
After you assign a value to reference, you cannot change the reference value.
- True
- False
C++ allows you to specify default parameter values to functions. Please state if these statement is true or false?
- True
- False
An array variable can be used to different types of data.
- True
- False
Unless specified otherwise, C ++ assumes all members of a class as public.
- True
- False
You can define a union variable in C++ without giving it a particular name. State whether the above statement is true or false.
- True
- False
Union definition does not allocate memory.
- True
- False
Each time your program creates a class variable, C++ automatically calls the class constructor function.
- True
- False
Macros execute faster than function calls.
- True
- False
To change the value of a union member within a function, your program must pass the union variable to the function by value.
- True
- False
You cannot overload a constructor function in C++.
- True
- False
Using macros instead of function decreases the size of the executable program.
- True
- False
Constructor & deconstructor functions are generally declared of the type void.
- True
- False
You can overload : (operator ) in C++.
- True
- False
In union, unlike a structure, your programs can only assign a value to one member at a time.
- True
- False
In C++, unless a function uses pointer or references, the function cannot change a parameter's values.
- True
- False
In C++, passing structure variable to a function results in compilation error.
- True
- False
In function overloading, the same function operates on different types of data.
- True
- False
Constructor function must always have the same name as the class.
- True
- False
C++ structure consists of one or more pieces of related data of the same type.
- True
- False
You can overload ?: (operator ) in C++. State whether the above statement is True or False.
- True
- False
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.
- True
- False
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.
- True
- False
You cannot pass parameters to a destructor function.
- True
- False
Your program uses the C++ operation keyword to overload an operator.
- True
- False
Constructor function in C++ cannot return a value. Is it true or false?
- True
- False