4 ms·
>and is the only way to get a dynamically sized heap-allocated 2D array in C (VLAs give you stack-allocated arrays, with all the size limits that entails). Why
by cf498 8y ago
>and is the only way to get a dynamically sized heap-allocated 2D array in C (VLAs give you stack-allocated arrays, with all the size limits that entails).
Why wouldnt you be able to create a dynamic array of arrays with placement new and a cast.
- int_19h 8y agoA cast to what, though? You need to be able to write the type of that array, but you can't do that unless dimensions are compile-time constants.