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++.

Show/hideSee also

Copyright © 2007-2008, 2011 ARM. All rights reserved.ARM DUI 0375C
Non-ConfidentialID061811