1/9
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the purpose of function prototypes in C?
Function prototypes inform the compiler about a function's name, return type, and parameters before its actual definition is encountered.
What is the significant outcome of collision detection in 1D?
A collision occurs when the right side of one square is greater than the left side of another and vice versa.
How do you detect a collision in both X and Y directions?
A collision is detected when both (x1 + s1 > x2 && x2 + s2 > x1) and (y1 + s1 > y2 && y2 + s2 > y1) are true simultaneously.
What are the two types of files in C and their purpose?
Source files (.c) contain the actual code, while header files (.h) contain declarations and include statements.
What does the 'extern' keyword do in C?
The 'extern' keyword allows the declaration of a global variable without initializing it, letting the linker find the variable's definition in another file.
What does a static variable in C signify?
A static variable retains its value between function calls and exists for the duration of the program.
What is a preprocessor macro in C?
A preprocessor macro is a fragment of code defined with '#define' that gets replaced by the preprocessor before compilation.
What is the difference between interpreted and compiled languages?
Interpreted languages execute code at runtime via an interpreter, while compiled languages generate machine-specific executable code before runtime.
What are global variables in terms of scope?
Global variables are visible everywhere within a program, except for static variables which limit visibility to the file they're defined in.
What happens to function and block-level variables without the static keyword?
They are allocated space on the call stack and their initial value is indeterminate (whatever was there previously in memory).