Code::Blocks Forums

User forums => Help => Topic started by: forestest on May 06, 2011, 09:48:58 pm

Title: "dynamic" array in c
Post by: forestest on May 06, 2011, 09:48:58 pm
Hi there,
I'm using C::B for developing C-Progs with the gcc-Compiler,
Why does the gcc-Compiler allow (no error) the declaration of the following "dynamic" Array:
--
void plateau(int *messDaten, int datenAnzahl){
    int zwischenWert[datenAnzahl];//not allowed in C !?! malloc or similar memory-allocation required ... ?!?
    //...
--
Other Compilers would show up an error like "Constant Expression/Term expected" - so would I have ...
Thx for your comments
Title: Re: "dynamic" array in c
Post by: MortenMacFly on May 06, 2011, 10:04:50 pm
Ask in a compiler forum, not in a forum related to an IDE. To avoid confusion, next time read the forum rules before posting. Thank you.