PS: Not to mention that if you use malloc then you will need to explicitly reclaim memory using free when the variable goes out of scope, while this happens automatically if you use alloca.