Exercise: Object Oriented Programming Using Cpp

Questions for: Object Oriented Programming Using Cpp

The #ifndef directive tests to see whether ________
A:
a class has been defined
B:
a variable has been given a value
C:
a class has no variable definitions
D:
any objects of the class have been instantiated
Answer: A

#ifndef checks whether the given token has been #defined earlier in the file or in an included file; if not, it includes the code between it and the closing #else or, if no #else is present, #endif statement. #ifndef is often used to make header files idempotent by defining a token once the file has been included and checking that the token was not set at the top of that file.

Header files often have the file extension _____
A:
.H
B:
.HE
C:
.HEA
D:
.HEAD
Answer: A
No answer description is available. Let's discuss.
If container classes are carefully constructed, then these tools are available to work with structures that are not ______
A:
valid without container classes
B:
programmer-defined
C:
type-specific
D:
public
Answer: C
No answer description is available. Let's discuss.
The keyword used to define a structure is _____
A:
stru
B:
stt
C:
struct
D:
structure
Answer: C
No answer description is available. Let's discuss.
A function that returns no values to the program that calls it is _____
A:
not allowed in C++
B:
type void
C:
type empty
D:
type barren
Answer: B
No answer description is available. Let's discuss.
Ad Slot (Above Pagination)
Quiz