Binary File I/O in C — fread, fwrite, fseek, and ftell
Learn how to read and write binary files in C with fread, fwrite, fseek, and ftell. Covers struct serialization, file positions, and cross-platform pitfalls.
Read articleArchive
Learn how to read and write binary files in C with fread, fwrite, fseek, and ftell. Covers struct serialization, file positions, and cross-platform pitfalls.
Read articleLearn how to implement a hash table in C with separate chaining. Covers hash functions, collision handling, dynamic resizing, and deletion.
Read articleLearn how two’s complement represents negative integers in C, why -1 is all ones in binary, how overflow works, and what this means for bit manipulation.
Read articleLearn how to use Valgrind to find memory leaks, invalid reads, use-after-free bugs, and uninitialized memory in C programs. With real output examples.
Read articleLearn how to use qsort in C to sort integers, strings, structs, and custom types. Understand the comparator contract and common mistakes.
Read articleLearn how C enums work, their size and underlying type, how to use them as flags, and the common pitfalls around assignment, comparison, and switch statements.
Read articleLearn where to place const in C declarations, the difference between const pointer and pointer to const, and how const correctness prevents bugs at compile time.
Read articleLearn when recursion causes stack overflow in C, how to calculate stack depth limits, tail recursion, and when iteration is a better choice.
Read articleLearn how to measure elapsed time in C using clock(), time(), clock_gettime(), and how to benchmark your code correctly across different platforms.
Read articleLearn how argc and argv work in C, how to parse flags and values, common pitfalls with string conversion, and how to validate arguments correctly.
Read article