Aggiungo che l'operatore di complemento a uno in C/C++ è ~ (tilde).
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum