Questions
C questions
Choose a question page, learn the concept, then test your understanding with a quiz.
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 Does the _t Suffix Mean in C Type Names?
Learn what the _t suffix means in C type names, how typedef aliases work, why hardware code uses them, and naming rules to follow.
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.
What Is a static Function in C? Internal Linkage Explained
Learn what a static function means in C, how internal linkage works, and why static prevents duplicate symbol errors across files.
What Is an unsigned char in C and C++? Meaning, Uses, and Differences from char
Learn what unsigned char means in C and C++, how it differs from char, and when to use it for bytes, raw data, and small integers.
What Is size_t in C? Meaning, Usage, and When to Use It
Learn what size_t means in C, why sizeof returns it, and when to use size_t instead of int in loops and array sizes.
What Is the LD_PRELOAD Trick in Linux and C?
Learn what the LD_PRELOAD trick is, how Linux uses it to override shared library functions, and when developers use it for debugging or tuning.
What `extern "C"` Does in C++
Learn what `extern "C"` means in C++, how it affects linkage, name mangling, and when to use it with C libraries.
What main() Should Return in C and C++
Learn the correct return type and arguments for main() in C and C++, why int main() is required, and when to return 0 or nonzero.
What static Means in C: Storage Duration and Linkage Explained
Learn what static means in C, including local static variables, file-scope static, and static functions with clear examples.
When Is Assembly Faster Than C? Performance, Compilers, and Real-World Tradeoffs
Learn when assembly can outperform C, why modern compilers are strong, and where hand-written assembly still matters in real systems.
When Valid C and C++ Code Behaves Differently: A Beginner-Friendly Guide
Learn why the same code can be valid in both C and C++ yet behave differently, with practical examples and key language rules.
When to Use & and * with Pointers in C
Learn when to use & and * in C pointers, including variables, arrays, strings, and function calls, with simple examples and common mistakes.
Why #ifndef and #define Are Used in C++ Header Files
Learn why #ifndef, #define, and #endif are used in C++ headers to prevent multiple inclusion and redefinition errors.
Why C Files Start With #include: Understanding the # Symbol in C
Learn why many C files begin with #include, what the # symbol means, and how preprocessor directives work in C programs.
Why C Has the Arrow Operator (->) for Struct Pointers
Learn why C uses the arrow operator (->) for struct pointers, how it relates to dereferencing, and why implicit pointer access is avoided.
Why C Math Functions Need -lm: Headers, Libraries, and GCC Linking
Learn why C programs often need GCC's -lm flag for math functions, while stdio.h and stdlib.h usually link automatically.
Why C/C++ Macros Use do { ... } while (0) and if/else Wrappers
Learn why C/C++ macros are wrapped in do-while(0) or if/else, how they prevent bugs, and when to use safer alternatives.