How to allocate memory for an array and a struct in one malloc call without breaking strict aliasing? – stackoverflow.com

When allocating memory for a variable sized array, I often do something like this: struct array { long length; int *mem; }; struct array *alloc_array( long length) { struct array *arr = ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

0 Comment to "How to allocate memory for an array and a struct in one malloc call without breaking strict aliasing? – stackoverflow.com"