Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. C Programming Fundamentals

Lesson 39 of 50 · c

C11 & C17 Modern Features

Duration: 12 mins

The C language evolves. Modern standards add safety, concurrency, and convenience.

FeatureHeaderUsage
_Static_assert<assert.h>Compile‑time assertion (_Static_assert(sizeof(int)==4, "int not 4 bytes");).
Anonymous structs/unions—Allows nested structs without a name (useful for low‑level memory mapping).
_Thread_local<threads.h>Declares thread‑local storage (_Thread_local int counter;).
alignas / alignof<stdalign.h>Controls/alters alignment constraints.
static_assert (macro)<assert.h>Same as _Static_assert but macro for pre‑C11 compilers.
generic selections<tgmath.h>Type‑generic macros (generic_max(1, 2.5) resolves to proper overload).
atomic types<stdatomic.h>Lock‑free atomic operations (atomic_int a; atomic_fetch_add(&a, 1);).
aligned_alloc<stdlib.h>Allocate memory with specific alignment.

📚 Example: Compile‑time Size Check

#include <assert.h>
_Static_assert(sizeof(void*) == 8, "Pointer size is not 8 bytes");
Previous: Dynamic Memory – Reallocating ArraysNext: Multithreading with `<threads.h>` (C11)