Home Segments Index Top Previous Next

613: Mainline

Once you understand how the flag-processing fragment works, you can, of course, copy it into other programs with appropriate modifications.

Note, however, that other programmers may choose to use pointer arithmetic to implement flag processing, rather than array notation. Still others may choose to use a mixture of pointer arithmetic and array notation, deploying one to iterate over character strings and the other to iterate over the command-line arguments. The version you have learned about here represents a personal opinion about which approach is the easiest to understand.