Home Segments Index Top Previous Next

607: Mainline

To check for flag-marking hyphens, you can use the following if statement:

if (argument_array[argument_counter][0] == '-') ... 

To understand how this if statement does its job, you first note that the value of the expression argument_array[argument_counter] is the location of a pointer to a character array. Then, recall that you can place a bracketed integer, such as [0], after such a pointer to select a particular character. Thus, argument_array[argument_counter][0] is the first character in the array identified by a particular pointer in the argument array.