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 - C Tutorial
From the course: Master C Language Pointers
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Understanding pointers to pointers4m 32s
-
(Locked)
Sending a pointer to a function3m 36s
-
(Locked)
Sorting pointers2m 6s
-
(Locked)
Managing memory3m 56s
-
(Locked)
Creating pointers to functions2m 30s
-
(Locked)
Challenge: Manipulate a pointer array1m 18s
-
(Locked)
Solution: Manipulate a pointer array3m 20s
-
(Locked)