4.76 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;


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