Questions

C questions

Choose a question page, learn the concept, then test your understanding with a quiz.

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.

cunit-testingtestingembedded

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.

clinuxmacrosoperators

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.

coperatorstrigraphs

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.

ccppsegmentation-fault

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.

ccpplinkagename-mangling

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.

ccppreturn-valueprogram-entry-point

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.

csyntaxstatic

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.

ccppc-preprocessorc++-faq

Why GCC Replaces linux with 1: Understanding Predefined Macros in C

Learn why GCC may replace `linux` with `1` in C, how predefined macros work, and how to write portable code safely.

clinuxgccc-preprocessor

Why `a[5]` Equals `5[a]` in C: Array Indexing and Pointer Arithmetic Explained

Learn why `a[5]` and `5[a]` mean the same thing in C by understanding array indexing, pointer arithmetic, and how subscripting works.

carrayspointerspointer-arithmetic

Why struct sizeof Is Larger Than the Sum of Its Members in C

Learn why sizeof(struct) can be larger than the sum of member sizes in C, including padding, alignment, and memory layout examples.

ccppstructsizeof

typedef struct vs struct in C: What's the Difference?

Learn the difference between `struct` and `typedef struct` in C, when to use each, and how they affect syntax in real C programs.

cstructtypedef

Page 2 of 2 - 32 questions