CPlusOOP
SiteMap
Building C++ Classes
Programming C++
Function/Variable Scope
«Prev
Function Prototypes
C++ Core
Convert C program--> C++
Using IO Stream - Exercise
Similarities in C/C++
Program Structure Differences
C++ Boolean Expressions
C++ String Functions
C++ improves casts
Declarations enumerated Types
Initializing enumerated lists
Declaration Scope
Preferred Comment Style
Differences Similarities C/C++
Basic C++ Quiz
Scope of Function
CPlus Function Prototype
default Function Arguments
Overloading Functions
CPlus inline Functions
File Local Scope
CPlus Storage Classes
Initializing external Static Variables
Linking Separate Modules
namspace scope
Anonymous Namespaces
Functions Variables - Conclusion
Functions Scope - Quiz
Pointers Memory Allocation
C++ const keyword
const pointer argument
reference Declarations
Call by Reference
C++ Generic Pointer
void formal Parameter
Free Store Operators
C++ new Operator
C++ delete Operator
Dynamic Array
Dynamic multi-dimensional
array allocation Function
array deallocate Function
findmax Function
C++ main function
memory Allocation Conclusion
Pointers Memory Allocation - Quiz
C++ Functions and Scope - Quiz
Each question is worth one point. Select the best answer for each question.
1.
The function header
int foo(int y, int x = 4)
means:
A.
y
is called by value
B.
x
has default value 4
C.
foo
returns an
int
D.
all of these
2.
When two functions with the same name are defined in the same scope, the function is:
A.
double
B.
static
C.
overloaded
D.
inline
3.
An overloaded function must have:
A.
different return types
B.
different executable statements
C.
different types and/or number of arguments
D.
all of these
4.
To speed up a function make it:
A.
use doubles
B.
static
C.
overloaded
D.
inline
5.
Only one of the following statements concerning resolving external references in multifile programs is true. Which one is it?
A.
External nonstatic variables must be defined in only one place.
B.
External static variables must be defined in only one place.
C.
Using the keyword
extern
with an initializer constitutes a declaration.
D.
Using the keyword
extern
without an initializer constitutes a definition.
6.
To provide a unique scope similar in effect to the use of static external declarations, use:
A.
a default argument
B.
an inline function
C.
an anonymous namespace
D.
a function prototype
Correct answers:
Your Score: 0
Submit
Quiz Explanation