[cs13001] Options
Mikhail Nesterenko
mikhail at cs.kent.edu
Tue Oct 23 23:22:46 EDT 2012
> But in regards to the lab, what would you use to call the one ship in
> void printShip (ship)
This is lab 8, right?
You are looking at the abbreviated function prototype. The function
accepts a single structure variable - ship and prints the ship's
location and status (sunk or not).
If you have an array of ships declared as follows:
ship battleFleet[FLEET_SIZE];
You may be able to invoke the function on the 4th element of this
array as follows:
printShip(battleFleet[3]);
Although, you may have to invoke this function inside a loop to print
all elements of the array.
Thanks,
--
Mikhail
More information about the cs13001
mailing list