In the version of trade_price
shown in Segment 295, the object
handed over was a trade
object taken from the trades
array:
trade_price(trades[counter])
In accordance with normal C argument-to-parameter rules, the
trade
object was copied.
Now, however, with trade_price
defined with a pointer
parameter, tptr
, the object handed over must be an address
of a trade
object. Accordingly, you need to use the
address-of operator, &
, which obtains the address of an
object in memory:
*-- Address-of operator produces an address | v trade_price(&trades[counter])