Question: are booleans initialized to false c++?
Answer: Only global variables are assigned 0 (false) by default, any local variables are given a non-zero garbage value, which would evaluate to true in a boolean variable. ... You need to either do bool x=false or bool x(false) . Primitives that are not initialized may have ANY value.