Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slide 19 global
- any line of code below a declared variable , within the same curly braces, can modify that variable.
- Global variables are bad. All functions can modify it. A Global variable sits outside of all functions.
- Global Variables are bad.
- Local variables are best. Local variables exist within and only within the functions they are declared in.
- There are static variables - variables that are not destroyed after the function ends.
- slide 20
- Static variables are always initialized to 0 by default, unless otherwise initialized.
- Only initialized once.
- Whatever its value at the end of function, is its value when the function is called again.
- STATIC VARIABLE LIVES OUTSIDE OF FUNCTION BUT CAN ONLY BE ACCESSED FROM WITHIN FUNCTION.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement