Home Segments Index Top Previous Next

292: Mainline

To write into the trades array, you can use assignment statements in which the array name, a bracketed integer index, and the structure-variable's name appear on the left side:

 *-- Array's name 
 |      *-- Array's index      
 |      |        *-- Structure variable name 
 |      |        |       *-- Value to be stored 
 v      v        v       v 
trades[counter].price = 10.2; 

To read data from the trades array, once the data have been inserted, you simply write an expression containing the array name, a bracketed integer index, and the structure-variable's name. The following expression, for example, yields the price of the trade stored in the place indexed by the value of counter.

trades[counter].price