4.79 Boolean type and <stdbool.h> in C99

C99 introduces the native type _Bool.

The associated standard header <stdbool.h> introduces the macros bool, true and false for Boolean tests. For example:
#include <stdbool.h>
bool foo(FILE *str)
{
    bool err = false;
    ...
    if (!fflush(str))
    {
        err = true;
    }
    ...
    return err;
}

Note

The C99 semantics for bool are intended to match those of C++.
Related concepts
4.63 New library features of C99
4.77 Additional <math.h> library functions in C99
4.78 Complex numbers in C99
4.80 Extended integer types and functions in <inttypes.h> and <stdint.h> in C99
4.81 <fenv.h> floating-point environment access in C99
4.82 <stdio.h> snprintf family of functions in C99
4.83 <tgmath.h> type-generic math macros in C99
4.84 <wchar.h> wide character I/O functions in C99
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.