From the course: Master C Language Pointers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding pointers to pointers

Understanding pointers to pointers - C Tutorial

From the course: Master C Language Pointers

Start my 1-month free trial

Understanding pointers to pointers

- [Instructor] Just as you can have an array of any data type, you can have an array of pointers. In fact you've probably seen it before as shown in this code in the arguments for the main function. The second argument is an array of pointers, essentially an array of strings but there's that asterisk operator. Here's the same code, but using the non array method of showing an array of pointers, two asterisks. Technically the argv variable is a pointer to a pointer, which is why two asterisks appear. So what does it all mean? An array of pointers is a collection of addresses. As with all pointers, these addresses must be initialized to hold the memory location of some variable. The pointer to pointers represents the location where the array of pointers is stored. Here's an illustration of a collection of pointers. They are character pointers in each references a string stored somewhere in memory. This collection of…

Contents