-
Pointers–STRUCTURED PROGRAMMING Course Notes
Pointers Pointer Variable Declarations & Initialization Pointers are variables that contain as their values memory addresses of other variables. The declaration: int *ptr; declares ptr to be a pointer to a variable of type int and is read, “ptr is a pointer to int.“ The *(asterisk) as used here in a declaration indicates that the variable is a pointer. There are 3 values that can be used to initialize a pointer: 0, NULL, or, an address of an object of the same type. The only integer that can be assigned to a pointer without casting is zero. Normally, a variable directly contains a specific value. A pointer contains the memory…