From the course: C Programming Basics: Flow Control, Variables, and Pointers

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Working with pointer arrays

Working with pointer arrays

- [Trainer] Just like any data type, you can create an array of pointers. It's an array of memory locations, but those pointers must reference some type of data. Why would anyone want to do such a crazy thing? Let me tell you here you see a pointer array. It contains room for 12 memory locations. Those locations are preset to the strings listed. This declaration is for an array of strings, although that's not technically correct. The strings are displayed by using a for-loop at line 21, build and run the code. Each string is displayed to help demonstrate that the array is a clutch of memory locations, modify the code in line 22 change the percent S to percent P. This change displays a memory location and not a string save, build and run and you see a series of memory locations because the compiler allocated space for each of the strings and stuck null characters at the end, each memory location does reference a…

Contents