What does "!" mean

What does “!” mean? Is it a boolean operator?

Here is an example of where it was used:

bool startGame = false;

do
{
  ShowStartScreen();
} while (!startGame);

Hi! Welcome to the forums.

“!” is a negation. Or, it inverts your condition.
Here, startGame = false, then !startGame would be the opposite, or, True.

!false = true and !true = false

Here is further explanation: https://stackoverflow.com/questions/22855483/using-exclamation-marks-in-c#22855594

3 Likes

i was going to respond but realized i couldn’t have said it better! gj

2 Likes