Namespaces
Variants
Views
Actions

bool literal

From cppreference.com
< cpp‎ | language
Revision as of 16:28, 19 April 2012 by P12bot (Talk | contribs)

Template:cpp/language/sidebar

Syntax

true (1)
false (2)

Explanation

  1. boolean true (value of 1)
  2. boolean false (value of 0)

Example

std::cout << std::boolalpha
          << true << '\n'
          << false << '\n'
          << std::noboolalpha
          << true << '\n'
          << false << '\n';

Output:

true
false
1
0