previous | index | next

Passing Structs to Functions

Test with:

test_struct_clear.cpp
gameState state;

state.pile1 = 5;
state.pile2 = 8;
clear(state);

assert(state.pile1 == 0 && state.pile2 == 0);

Q: Output?

    Assertion `state.pile1 == 0 && state.pile2 == 0' failed.
Q: Why the failure?

A:


previous | index | next