Chapter 4
Chapter 4
Programming
with C++
Reema Thareja
• Function name and the number and type of arguments in the function call must
be the same as that given in the function declaration and function header of the
function definition.
• If, by mistake, the parameters passed to a function are more than specified to
accept, then the extra arguments will be discarded.
• If, by mistake, the parameters passed to a function are less than specified to
accept, then the unmatched argument will be initialized to some garbage value
(i.e. arbitrary meaningless value).
• Names, and not the types, of variables in function declaration, function call, and
header of function definition may vary.
• Arguments may be passed in the form of expressions to the called function.
File Scope
• When a global variable is accessible until the end of the file,
the variable is said to have file scope.
• To allow a variable to have file scope, declare that variable
with the static keyword before specifying its data type as
follows: