Viewing bool Variables as Literals

By default, iostream objects display bool variables as 0 and 1. You can override the default setting by inserting the formatting flag boolalpha to the object stream. Consequently, the symbolic representations ‘false’ and ‘true’ will be displayed instead:

 #include using namespace std;void main() {     bool b = true; cout<
Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: