C Programming Language Flashcards
Functional Prototypes
Functions need to be defined before “main()” function
Function arguments work how?
In C, all function arguments are passed “by value”
Meaning of Passed “By Value”?
The called function is given the values of its arguments in temporary variables rather than the originals
Passed “By Value” Is different than other languages, how?
“Call by reference” - that allows the called routine to get the originals, not the copies
Called by value - is?
An asset, not a liability
C - Function Variables
(passed by) Value - copy ( not originals - a temporary copy )
It is possible for (C) - to reference a variable directly, How?
The caller must provide the address of the variable to be set. Technically a pointer to said variable
in C - Arrays - are different, How?
They are always referenced by originals
Local Variables, are?
Automatic Variables
Local Vs. External - variables?
Alternative to ‘local’ variable - is ‘external’ variable
Condition of External Variables
If the definition of an external variable occurs in the source file before its use in a particular function, then there is no need for an ‘extern’ declaration in the function
“Definition”
Refers to the place where the variable is created or assigned storage
“Declaration”
Refers to the place where the nature of the variable is stated but no storage is allocated
variable habit?
There is a tendency to use variables for everything!
variable - caution:
But extern variables are there - even when you don’t want them