C/C++ Arena

Step 2 of 6

Structs in functions

Structs can be passed to and returned from functions like any value (the whole struct is copied).

Your turn: write double kd(struct Player p) that returns kills divided by deaths as a double. If deaths is 0, return the kills.

Previous: Define a struct Next: Pointers to structs and ->