EECE 2160 Lecture Notes - Lecture 2: Memory Management, Null Pointer, Dereference Operator
Document Summary
Before a c program starts running, the os places variables in a specific position in a large memory space. On 32 bit machines, this memory space is composed of 2^32 byte positions. A pointer is a 32-bit integer number that can refer to any of these positions. The address-of operator int x = 10; printf( %p \n , &x) Int *x x is a memory address pointing to a region of memory that contains a variable of type int . If we don"t initialize the variable, it can point to anything, even if that anything is an invalid memory location. Regardless of type of the variable, it occupies 32 bits. Is used to access (read or write) the memory content referenced by a pointer. int x = 10; int *p = &x; x. *p = 20; equivalent to x = 20; Variable v is the base address of a sequence of ten initialized consecutive 4-byte signed integers.