Before variable-length arrays were supported, I would dynamically allocate them like this:
int foo(size_t n) { int *arr = malloc(n * sizeof int); if (!arr) return ENOMEM; ...
I'm trying to expand an array of ints on the heap using realloc but the programme is crashing when I use my custom function "ExpandArrayOfInts" but works fine when I write ...