Jay Taylor's notes

back to listing index

resizing an array with C - Stack Overflow

[web search]
Original source (stackoverflow.com)
Tags: programming array c allocation stackoverflow.com
Clipped on: 2013-11-07

So I need to have an array of structs in a game I'm making - but I don't want to limit the array to a fixed size. I'm told there is a way to use realloc to make the array bigger when it needs to, but can't find any working examples of this.

Could someone please show me how to do this?


asked May 30 '10 at 3:25
Image (Asset 1/3) alt=