struct gameState { int pile1; int pile2; }; void clear(gameState g) { g.pile1 = 0; g.pile2 = 0; }
Will this work? That is, can a caller of clear expect the original struct to be modified?