in an effort to only ask what I\'m really looking for here... I\'m really only concerned if it\'s considered bad practice or not to declare an array like below where the siz
That depends. The first clearly isn't what I'd call "proper", and the second is only under rather limited circumstances.
In the first, you shouldn't cast the return from malloc
in C -- doing so can cover up the bug of accidentally omitting inclusion of the correct header (
).
In the second, you're restricting the code to C99 or a gcc extension. As long as you're aware of that, and it works for your purposes, it's all right, but hardly what I'd call an ideal of portability.
As far as what you're really asking: with the minor bug mentioned above fixed, the first is portable, but may be slower than you'd like. If the second is portable enough for your purposes, it'll normally be faster.