Questions

C questions

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

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.

cfunctionstaticterminology

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.

ccppchar

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.

cintsize-t

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.

clinuxenvironment-variables

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

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.

cperformanceassembly

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.

ccpp

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.

cpointers

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.

ccppc-preprocessor

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.

cc-preprocessor

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 ENOENT Means "No Such File or Directory" in C and Unix Error Codes

Learn why ENOENT means "No such file or directory," what ENT stands for, and how Unix/C error codes are named and used.

clinuxunix

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 Hexadecimal Numbers Use the 0x Prefix

Learn why hexadecimal numbers use the 0x prefix, what it means, and how number literals are written in programming languages.

csyntaxhex

Why Use Pointers in C++? A Beginner-Friendly Guide

Learn why pointers matter in C++, when to use them, and how they work with arrays through clear examples and practical guidance.

ccpppointers

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 `printf` Flushes on Newlines in C: Buffering Explained

Learn why `printf` may not flush immediately in C, why newlines matter, and how to force output to appear right away.

cprintfflush

Why `sizeof(x++)` Does Not Increment `x` in C

Learn why `sizeof(x++)` does not evaluate `x++` in C, how `sizeof` works, and when expressions inside it are executed.

csizeof

Page 5 of 6 - 112 questions