On this page
  1. char
  2. Availability
  3. Syntax & Overview
  4. Notes & Pitfalls
  5. Example

char

Prev: void | Up: builtins | Next: int
Rel: Arrays & C Strings, ctype.h
Ref: cppreference — char
Tags: #public #prog #c #builtins #tier/core


Availability

Built-in (Built-in Type) — requires no #include header.

Syntax & Overview

char  |  signed char  |  unsigned char

Smallest addressable unit (always sizeof(char) == 1). Signedness of plain char is implementation-defined.

Notes & Pitfalls

Example

#include <assert.h>
#include <ctype.h>

int main(void) {
    char ch = 'a';
    assert(toupper((unsigned char)ch) == 'A');
}

Linked from

Related notes