a #define preprocessor directive Function-like macros look similar to functions, but they are actually text that is replacement before the program is compiled
Simulated in C by using pointers Make a copy of address & modify the contents Used in C arrays & pointers We will cover pass by reference later in the semester… Debit Card
the actual parameters and the formal parameters, the actual parameters will be converted to match the formal parameters See example code at coercion.c, where doubles are converted into integers
not listed, then the compiler will assume it is of type "int" The return type and the argument types of the function prototype & the function definition must be the same For example, see bugs.c
visible inside the block Variables declared inside a block may hide any identically named variables in outer blocks Will remain in existence until the matching right brace
macro name The scope of a symbolic constant or macro is from its definition until it’s undefined with #undef, or until the end of the file Once undefined, a name can be redefined with #define
it exists in memory Scope (file, function & block) Where it can be referenced in a program Linkage (internal & external) Whether a variable is accessed only in current source file or in other source files
exists while block is active Variable destroyed when block is exited Default for all variables inside functions int main(void){ auto int x = 100; }
any function that follows its declaration Has static storage duration Default for global variables and functions Don’t have to explicitly type “extern,” unless shared by multiple files
the life of the program Use anywhere in the program static Exists for the life of the program Only use inside the function where it is declared auto, register (local variable) Exists for the life of the function Only use inside the function where it is declared