이름공간
변수
행위

Type support

cppreference.com
< c

목차

[편집]Basic types

[편집] Fundamental types defined by the language

[편집]Additional basic types and convenience macros

<stddef.h> 헤더에 정의됨.
sizeof 연산자로 반환된 부호없는 정수타입
(typedef)[edit]
두 포인터를 뺀 경우에 부호있는 정수 타입을 반환한다.
(typedef)[edit]
널 포인터 상수
(macro constant)[edit]
a type with alignment requirement as great as any other scalar type
(typedef)[edit]
byte offset from the beginning of a struct type to specified member
(function macro)[edit]
<stdbool.h> 헤더에 정의됨.
bool
(C99)
convenience macro, expands to _Bool
(keyword macro)
true
(C99)
expands to integer constant 1(until C23)((_Bool)+1u)(since C23)
(macro constant)
false
(C99)
expands to integer constant 0(until C23)((_Bool)+0u)(since C23)
(macro constant)
__bool_true_false_are_defined
(C99)
expands to integer constant 1
(macro constant)
<stdalign.h> 헤더에 정의됨.
alignas
(C11)
convenience macro, expands to keyword _Alignas
(keyword macro)
alignof
(C11)
convenience macro, expands to keyword _Alignof
(keyword macro)
__alignas_is_defined
(C11)
expands to integer constant 1
(macro constant)
__alignof_is_defined
(C11)
expands to integer constant 1
(macro constant)
<stdnoreturn.h> 헤더에 정의됨.
noreturn
(C11)
convenience macro, expands to _Noreturn
(keyword macro)

[편집] Fixed width integer types(since C99)

[편집] Numeric limits

[편집]Notes

The type of true and false is int rather than _Bool.

(since C99)
(until C23)

A program may undefine and perhaps then redefine the macros bool, true and false. However, such ability is a deprecated feature.

(since C99)

[편집]Example

#include <stdio.h>#include <stdbool.h>#include <stdalign.h>   int main(void){printf("%d %d %d\n", true&&false, true||false, !false);printf("%zu\n", alignof(char));}

Output:

0 1 1 1

[편집]References

  • C17 standard (ISO/IEC 9899:2018):
  • 7.15 Alignment <stdalign.h> (p: 196)
  • 7.18 Boolean type and values <stdbool.h> (p: 210)
  • 7.19 Common definitions <stddef.h> (p: 211)
  • 7.23 _Noreturn <stdnoreturn.h> (p: 263)
  • 7.31.9 Boolean type and values <stdbool.h> (p: 332)
  • C11 standard (ISO/IEC 9899:2011):
  • 7.15 Alignment <stdalign.h> (p: 268)
  • 7.18 Boolean type and values <stdbool.h> (p: 287)
  • 7.19 Common definitions <stddef.h> (p: 288)
  • 7.23 _Noreturn <stdnoreturn.h> (p: 361)
  • 7.31.9 Boolean type and values <stdbool.h> (p: 456)
  • C99 standard (ISO/IEC 9899:1999):
  • 7.18 Boolean type and values <stdbool.h> (p: 253)
  • 7.19 Common definitions <stddef.h> (p: 254)
  • 7.26.7 Boolean type and values <stdbool.h> (p: 401)
  • C89/C90 standard (ISO/IEC 9899:1990):
  • 4.1.5 Common definitions <stddef.h>

[편집]See also

C++ documentation for Type support library
close