O'Reilly logo

C Programming: Visual Quickstart Guide by Marc Liyanage, Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Arrays of Pointers

So far you have used only single pointer variables, but you can also use arrays of pointer variables if you need to store a series of addresses. One such need for an array of pointers is when dealing with a series of text strings (character arrays). This will be demonstrated using the command-line arguments that a C program can receive when it is started.

When you run a compiled C program, you can optionally add a number of arguments that are passed to that program. From a command-line interface, arguments are separated by one or more blank spaces, and come after the application name (Figure 9.15). In this figure, pointer9 is the program name and aaa and bbb are two separate arguments.

Figure 9.15. C programs can receive a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required