COMPTNG 10A Lecture Notes - Lecture 4: Memory Address
Document Summary
A variable is stored somewhere in memory. The address-of operator (&) returns the memory address of the variable. Arrays are actually (98%) pointers! int ages[10]; int* ptr = ages; // ptr has address of ages[0: ptr[0] to ptr[9] to print all of ages, since ages is of type int*, it points to a memory address at which an integer is stored. It points to the beginning of the 0th int. If you create an int, then create another int, they may not be in memory addresses next to each other: however, within an array, each value/byte will be next to each other.