1/12
Flashcards about Arrays and Pointers in C Systems Programming
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Pointer
A variable that contains a memory address.
Dereference
Access the memory referred to by a pointer.
Pass by reference
Pointers allow C to emulate this.
Auto Storage Class
Variables that are automatically allocated and deallocated (local function variables declared on stack).
Global Storage Class
Globally defined variables that can be accessed anywhere within the program.
Static Storage Class
A variable that is global to the local file only (static global variable) or to the scope of a function (static local variable).
Array Initialization
Allocates an array and fills it with supplied values; if fewer values are given than the array size, fills rest with 0.
Multi-dimensional Arrays
Allocates a 2D array and fills it with predefined values.
Pointer
Array name can be used as this to the 0th element.
Pointer Arithmetic
Adding integer i to pointer p yields a pointer to the element i places after the one that p points to.
Arrays as Function Parameters
When passing an array as an argument to a function, the address of the 0-th element is passed by value – copied to a pointer in the callee.
Virtual Memory
Each process has the illusion of its own, private memory.
ASLR
Randomizes executable code location, base of stack, and shared library location for added security.