The C language is defined by ISO standards. C89/C90 is the classic baseline. C99 added // comments, mixed declarations, long long, bool, VLAs, inline, and designated initializers. C11 added _Static_assert, _Generic, threads, and atomics. C17 is a bug-fix release of C11. C23 adds bool as a keyword, nullptr, constexpr, and more. Choose with -std=.
Keep these facts handy while you work with Language Standards (C89 to C23) in C.
Topic
Detail
C89
No //, no long long
C99
bool, VLAs, inline, restrict
C11
_Static_assert, _Generic, <threads.h>
C23
nullptr, constexpr, #embed
Code
C Examples
Compile each example with gcc file.c -std=c11 -Wall -o out. Next: Data Structures.
Example 1 — C99 features in one program
Compile with -std=c99 or later.
C
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
int main(void) {
bool ok = true; /* C99 bool */
for (int i = 0; i < 2; i++) { // C99: declaration in for, // comments
printf("i=%d ok=%d\n", i, ok);
}
printf("LLONG_MAX = %lld\n", LLONG_MAX); /* C99 long long */
return 0;
}
Output
i=0 ok=1
i=1 ok=1
LLONG_MAX = 9223372036854775807
How It Works
bool, true, and false come from <stdbool.h> in C99.
Declaring i inside the for header is a C99 feature.
long long is at least 64 bits, so the maximum is 9223372036854775807.
Edge Cases & Pitfalls
Check these before relying on Language Standards (C89 to C23) in real programs.
default
Relying on the default standard
GCC defaults to a GNU dialect that varies by version. Set -std= explicitly for repeatable builds.
msvc
MSVC support
Older MSVC versions support only parts of C99. Check your compiler, or use Clang on Windows.
Remember
Key Takeaways
Pick: choose -std= deliberately.
C11: good default.
Features: know what each adds.
One line: The C language is defined by ISO standards.
Frequently Asked Questions
C23 (ISO/IEC 9899:2024) is the latest. C17 is the previous one and mainly fixes defects in C11.
C11 or C17. They include everything from C99 plus useful additions like _Static_assert and are widely supported.
Continue with "C Data Structures" next. Learn what data structures are, how they are classified, and how to choose one for your C program. The C Advanced Concepts hub lists every topic in order.