Questions
C questions
Choose a question page, learn the concept, then test your understanding with a quiz.
Performance Comparison in C, Python, Erlang, and Haskell: Why the Same Algorithm Runs at Different Speeds
Learn why identical algorithms perform differently in C, Python, Erlang, and Haskell, including integer costs, runtimes, and optimization tips.
Should You Cast malloc in C? Understanding malloc Return Types
Learn whether to cast malloc in C, why it is usually avoided, and how to write safer dynamic memory allocation code.
Static vs Dynamic Linking: Performance Differences Explained
Learn static vs dynamic linking, runtime performance trade-offs, startup costs, memory sharing, and when each approach matters.
Static vs Shared Libraries in C/C++: What’s the Difference?
Learn the difference between static and shared libraries in C/C++, how linking works, and when to choose each in real projects.
Strict Aliasing Rule in C: What It Means and Why It Matters
Learn the strict aliasing rule in C, why breaking it causes undefined behavior, and how to safely reinterpret memory.
Undefined Behavior vs Unspecified vs Implementation-Defined Behavior in C and C++
Learn the difference between undefined, unspecified, and implementation-defined behavior in C and C++ with examples and common mistakes.
Undefined Behavior with Pre-Increment and Post-Increment in C
Learn why expressions like i = i++ + ++i are undefined behavior in C, how evaluation order works, and how to write safe code.
Understanding Pointers in C and C++: Why They Are Hard and How to Learn Them
Learn why pointers confuse C and C++ beginners, how they work, and practical ways to understand memory, addresses, and dereferencing.
Understanding __attribute__((constructor)) and __attribute__((destructor)) in C and C++
Learn how __attribute__((constructor)) works, when it runs, and how destructor functions behave in C and C++ with clear examples.
Understanding `const int*`, `const int * const`, and `int * const` in C and C++
Learn the difference between pointer const forms in C and C++: `const int*`, `int* const`, and `const int* const` with clear examples.
Understanding do { ... } while (0) in C Macros
Learn why C programmers use do { ... } while (0) in macros, how it prevents bugs, and when to use it in real code.
Understanding the `-->` Pattern in C and C++
Learn why `while (x --> 0)` works in C and C++, how it is parsed, what operators are involved, and when to avoid this syntax.
Understanding typedef Function Pointers in C
Learn what typedef function pointers mean in C, why the syntax looks unusual, and how they are used with DLLs and dynamic loading.
Unit Testing in C for Embedded Systems: A Beginner-Friendly Guide
Learn how unit testing works in plain C, including embedded-friendly strategies, test frameworks, mocks, and practical examples.
What Are .a and .so Files in C? Static vs Shared Libraries Explained
Learn what .a and .so files are in C, how static and shared libraries work, and how they are used when building and running apps.
What Does `:-!!` Mean in C? Bit-Fields, Compile-Time Errors, and Linux Macros
Learn what `:-!!` means in C, how Linux uses it in macros, and how negative bit-field widths trigger compile-time errors.
What Does `??!??!` Mean in C? Trigraphs and How the Code Really Works
Learn what `??!??!` means in C, how trigraphs work, and why this strange code compiles. Beginner-friendly explanation with examples.
What Happens If You Don’t Free Memory Before Program Exit in C?
Learn what really happens when malloc memory is not freed before program termination, when it matters, and how C programs should manage memory.
What Is Linux’s Native GUI API? Understanding X11, Wayland, GTK, and Qt
Learn what “native GUI API” means on Linux and how X11, Wayland, GTK, and Qt fit together in Linux desktop apps.
What Is a Segmentation Fault in C and C++?
Learn what a segmentation fault means in C and C++, how it relates to invalid memory access, and why dangling pointers can cause it.