Functions Flashcards
advantages of using functions
code isnt duplicated
we can reuse common utilities
problems can be broken up into sub problems
unit testing
general layout for a function header
>return type< >function name< () { function body }
how to separate parameters in function lsit
using commas`
which are the functions ttat everyone can see
public`
3 things that can be sent into a function
call by value parameters
call by reference parameters
member data
3 things that are returned from a function
member data
return type
call by reference parameter`
why shouldnt you use parameters as local varibales in functions
because this will change the value of that parameter outside the function which may not be your intention
can local variables in one function be acessed by code in another functoin
no, unless the variables are constants
variables that are defined in the parameter list are in scope until
The function ends
what is recursion
the calling of a function within the function itself