Questions

C questions

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

Find an Array Size from a Pointer in C

Learn why C pointers do not store array lengths, how sizeof works before array decay, and safe ways to pass array sizes to functions.

carrayspointerssizeof

Finding C and C++ Standard Documents: Official Copies and Free Drafts

Learn where to find official C and C++ standards, free committee drafts, historical editions, and reliable online reference resources.

ccppstandardsc++-faq

Finding Core Dump Files in C on Linux

Learn why C programs report “core dumped” without a local file, and how Linux core patterns, systemd, limits, and permissions control dumps.

clinuxcoredump

Fixing "Undefined Reference to pthread_create" in C on Linux

Learn why C code using pthread_create fails to link on Linux and how to compile pthread programs correctly with gcc and -pthread.

clinuxmultithreadingpthreads

Fixing "missing separator" in a Makefile (GNU Make)

Learn why GNU Make shows "missing separator" and how to fix tabs, recipe syntax, and command formatting in a Makefile.

cmakefile

Float vs Double: Difference in Precision, Range, and Memory

Learn the difference between float and double, when they are interchangeable, and how precision, range, and memory affect results.

ccppfloating-pointprecision

Forward Variable Arguments in C with va_list and v Functions

Learn how to forward C variadic function arguments safely using va_list, va_start, va_copy, and va_end with vprintf-style functions.

cvariadic-functions

How C free() Knows What to Free: Heap Metadata and Dynamic Memory

Learn how C free() knows what memory block to release, how allocators store size metadata, and why arrays still need lengths.

cpointersfree

How Function Pointers Work in C: Syntax, Examples, and Practical Use

Learn how function pointers work in C with clear syntax, examples, callbacks, and common mistakes beginners should avoid.

cfunction-pointers

How Many Levels of Pointers Can You Have in C?

Learn how many pointer levels C allows, how multi-level pointers work, and when double or triple pointers are used in real code.

ccpppointerslanguage-lawyer

How sykes2.c Works: Explaining an Obfuscated C Program That Prints __TIME__

Learn how the obfuscated C program sykes2.c works, including recursion, __TIME__, bit tricks, indexing, and ASCII output in C.

cobfuscationdeobfuscation

How to Allocate Aligned Memory Using the C Standard Library

Learn how aligned memory allocation works in C, what the standard library supports, and how to safely allocate and free aligned memory.

cmemory-management

How to Check If a File Exists in C++ and C

Learn standard ways to check whether a file exists in C++11, C++17, and C, with examples, trade-offs, pitfalls, and practical usage tips.

ccppfilestream

How to Check if a File Exists in C

Learn practical ways to check if a file exists in C, including fopen, access, and stat, with examples, pitfalls, and best practices.

cfilesystemscross-platform

How to Choose a C Programming Book and Build a C Learning Path

Learn how to evaluate C programming books, choose one for your level, and use a practical study plan with safe, standards-aware C examples.

c

How to Concatenate Strings Safely in C

Learn why strcat with string literals crashes in C and how to concatenate strings safely using writable buffers and snprintf.

cstringconcatenation

How to Detect Unsigned Integer Overflow in C++

Learn how to detect unsigned integer overflow in C++ safely, with multiplication checks, examples, pitfalls, and practical patterns.

ccppinteger-overflow

How to Determine Array Size in C

Learn how to find the number of elements in a C array using sizeof, with examples, pitfalls, and best practices for beginners.

carrays

How to Divide a Number by 3 Without Using Arithmetic Operators

Learn how to divide a signed or unsigned number by 3 without using *, /, +, -, or % by using bitwise operations and repeated subtraction.

cmathbit-manipulationdivision

How to Find the Number of CPU Cores in C and C++

Learn how to detect CPU core counts in C and C++, including portable options and platform-specific methods for Windows, Linux, Unix, and macOS.

ccppmultithreadingmultiplatform

Page 3 of 9 - 162 questions