Loading…
Loading…
Topic
Articles and problems tagged Memory Management.
See how the FAT file system, still used on USB sticks and memory cards, records where every file is stored: boot sector, FAT, directory and data area, clusters, and FAT chains that work like linked lists. Then decode 12-bit and 16-bit FAT entries correctly with pointers and bitwise operators.
Old 16-bit PCs reached 1 MB of memory by combining a segment and an offset, which gave C three kinds of pointer: near, far and huge. Learn how segment:offset addressing worked, why two far pointers to the same byte could compare unequal, and how normalization fixed it.
Build arrays that hold addresses, and allocate memory while the program runs with malloc, calloc, realloc and free. Learn to size requests with sizeof, check for NULL and avoid memory leaks.
Why pointers have types, how passing addresses lets a function change the caller's variables (call by reference), and how to return pointers safely without leaving them dangling.