Tag: malloc and free
-
Build Your Own std::vector in C
Over the years of working with C, I often found myself stuck when dealing with dynamically resizable data structures. More often than not, I’d end up allocating a huge fixed-size array which worked at first but soon became a pain to maintain. Tracking index positions, avoiding segmentation faults, and ensuring I wasn’t accessing non-existent memory…