Printable View
Sorry to barge in, but how to convert a boolean to an integer? SK
I think a boolean already is an interger that has either the value 0 or 1.
Quote: Originally Posted by anon I think a boolean already is an interger that has either the value 0 or 1. Yes, it should convert automatically to integer - or a cast will do the job. Code: static_cast<int>(somebool) [I think - I always get confused about the C++ casts] -- Mats
static_cast<int>(somebool)