Stack vs Heap in C — What Every Programmer Must Know
Understanding the stack and heap in C is fundamental. Learn where each type of variable lives, how memory is managed, and when to choose each.
Read articleTutorials, tips and guides for C programmers — from beginner mistakes to advanced systems programming.
Understanding the stack and heap in C is fundamental. Learn where each type of variable lives, how memory is managed, and when to choose each.
Read articlesizeof in C has surprising edge cases with arrays, structs, pointers, and function parameters. Learn them all before they catch you out.
Read articleLearn how to read files in C using fopen, fgets, fread, and fscanf. Real code examples showing when to use each function.
Read articleMaster the C switch statement. Learn fall-through behaviour, break placement bugs, why strings don’t work, and the most common mistakes.
Read articleA dangling pointer points to memory that no longer belongs to your program. Learn the three ways this happens and how to avoid each one.
Read articleLearn which GCC warning flags to always enable and what bugs they catch before your program crashes.
Read articleUnderstand C pointers once and for all. Memory addresses, dereferencing, pointer arithmetic, and double pointers explained with ASCII diagrams.
Read articlechar* and char[] look similar but behave completely differently in C. Learn the memory layout, mutability, and sizeof differences.
Read articleGetting a segfault in C? Here are the 7 most common causes with real code examples and fixes.
Read articleLearn the difference between malloc, calloc, and realloc in C with real code examples. Know which one to use and when.
Read article