5.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;
}

Note:

The C99 semantics for bool are intended to match those of C++.

Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.