On this page
STDC_VERSION
Prev: __LINE__ | Up: builtins | Next: const
Rel: Preprocessor & Macros
Ref: cppreference — STDC_VERSION
Tags: #public #prog #c #builtins #tier/standard
Availability
Built-in (Predefined Macro) — requires no #include header.
Syntax & Overview
__STDC_VERSION__
Expands to a long integer constant identifying the C standard version (201112L C11, 201710L C17, 202311L C23).
Notes & Pitfalls
- Standard version integer:
199901L(C99),201112L(C11),201710L(C17),202311L(C23)—guard modern features with#if __STDC_VERSION__ >= 201112L.
Example
#include <stdio.h>
int main(void) {
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
puts("C11 or newer");
#endif
}
Linked from
Related notes
- tuts/c/builtins/__LINE__ Linked here; links to this page; shared tags: #builtins, #c, #prog, #tier
- tuts/c/builtins/const Linked here; links to this page; shared tags: #builtins, #c, #prog, #tier
- tuts/c/builtins Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/compilation_and_internals/preprocessor_and_macros Linked here; shared tags: #c, #prog
- tuts/c/builtins/__FILE__ shared tags: #builtins, #c, #prog, #tier
- tuts/c/builtins/__func__ shared tags: #builtins, #c, #prog, #tier
- tuts/c/builtins/_Alignof shared tags: #builtins, #c, #prog, #tier
- tuts/c/builtins/_Atomic shared tags: #builtins, #c, #prog, #tier
- tuts/c/builtins/_Generic shared tags: #builtins, #c, #prog, #tier
- tuts/c/builtins/_Noreturn shared tags: #builtins, #c, #prog, #tier