Questa funzionalità si chiama
VLA (Variable-length_array)
ed è supportata da C99 (starai usando un compilatore che supporta tale caratteristica).
Standard precedenti non supportano questa funzionalità e personalmente, non la adotto.
Per approfondimenti
http://en.wikipedia.org/wiki/Variable-length_array