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

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

Example

#include <stdio.h>

int main(void) {
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
    puts("C11 or newer");
#endif
}

Linked from

Related notes