Home Segments Index Top Previous Next

610: Mainline

Once flags cause switches to be set, all your program needs to do is to test those switches when it is time to act. For example, the following statement displays the price per share, once mean_price is defined, as long as the value of the mean_price_switch is 1:

if (mean_price_switch == 1) 
  printf ("The mean price per share of the trades is %.2f.\n", 
          mean_price (trade_pointers, limit));  
...