#ellens-alien-game. C++ member function that takes no parameters and does not return anything.

4 messages · Page 1 of 1 (latest)

feral kiln
#

This is just a n00b hurdle, I'm sure. There isn't an example to follow.
void hit(){
if (health > 0) {
--health;
}
}
Is giving me:
/tmp/ellens-alien-game/ellens_alien_game_test.cpp:32:22: error: invalid use of void expression
32 | REQUIRE(alien.hit());
| ~~~~~~~~~^~

I simply have no idea what's wrong here.

arctic perch
#

What does the spec way?

patent bridge
#

What's in the header?

feral kiln
#

Spec says something I'd missed !