generated from rit-ecet-notes/new-course
Add extern
This commit is contained in:
parent
57be9b511f
commit
13edde611e
1 changed files with 6 additions and 0 deletions
6
notes.md
6
notes.md
|
@ -314,3 +314,9 @@ Deprecated; restricts value to a certain space in memory.
|
|||
`register` is a ***suggestion*** to store this value in a register, dw about it.
|
||||
`static` limits the visibility of the function, and will keep variable instantiation between function calls.
|
||||
Useful for only modifying values inside a function, but persisting the values.
|
||||
|
||||
---
|
||||
|
||||
`extern` specifies to specifically not make storage for it, and it must be defined exactly once as a global variable in another file.
|
||||
Its great, because you don't need to create a bunch more variables.
|
||||
But it's also terrible, because of potential race conditions, and non-obvious data connections.
|
||||
|
|
Loading…
Add table
Reference in a new issue