On this page
  1. bool
  2. Include
  3. Signature & Overview
  4. Notes & Pitfalls
  5. Example

bool

Prev: stdbool.h | Up: stdbool.h | Next: limits.h
Rel: stdbool.h, stdint, stdbool & limits Guide
Ref: cppreference — bool
Tags: #public #prog #c #stdlib #stdbool #tier/core


Include

#include <stdbool.h>

Signature & Overview

bool  /* macro for _Bool in C99-C17, keyword in C23 */

Boolean type holding only 0 (false) or 1 (true).

Notes & Pitfalls

Example

#include <assert.h>
#include <stdbool.h>

int main(void) {
    bool ok = true;
    assert(ok && !false);
}

Linked from

Related notes