News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

"dynamic" array in c

Started by forestest, May 06, 2011, 09:48:58 PM

Previous topic - Next topic

forestest

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

MortenMacFly

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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]