1/14
Vocabulary flashcards covering key terms from the lecture on pointers, arrays, command-line arguments, and function pointers.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Row-Major Order
The memory layout used by C in which consecutive elements of a row of a multidimensional array are stored contiguously.
Multidimensional Array Declaration
In C, all dimensions except the first must have explicit bounds (e.g., int x[][4] is valid, but int x[][] is not).
Array Decay
The automatic conversion of an array name to a pointer to its first element when passed to functions or used in expressions.
Array of Strings (Fixed-Width)
A declaration such as char planets[][8] where each string occupies a fixed number of bytes in a 2-D char array.
Array of Pointers to Strings
A declaration like char *planets[] in which each element is a pointer to a separately stored null-terminated string.
Pointer Arithmetic on String Arrays
Iterating with char **p = planets; p < planets+8; ++p lets you traverse an array of string pointers using address arithmetic.
argc
An int parameter to main indicating the number of command-line arguments, including the program name.
argv
An array of char pointers passed to main that stores each command-line argument as a null-terminated string.
Double Pointer (int **, char **, etc.)
A variable that stores the address of another pointer, enabling modification of the pointer itself inside functions.
swapception
An example function void swapception(int **xp, int **yp) that swaps two pointer variables using double pointers.
Triple Pointer
A pointer to a double pointer (e.g., char ***cpp) often used for complex data structures or indirection chains.
Function Pointer Syntax
void (*func_ptr)(int,int) declares a pointer to a function taking two ints and returning void.
Calling via Function Pointer
Using (*funcptr)(10,5) (or funcptr(10,5)) to invoke the function to which the pointer currently refers.
qsort
Standard library function void qsort(void base,sizet nmemb,sizet size,int(compar)(const void,const void)) that sorts an array using a user-supplied comparison function.
Comparator Function
A function like int cmpfunc(const void *a,const void *b) passed to qsort that returns negative, zero, or positive to indicate ordering between two elements.