I used Microsoft Visual Studio to write a C code in C++ project and It's working fine there when I convert the file extension from my.cpp to my.c and tried to run in via TurboC++ 3.0 then it gives me number of errors like "Constant Expression Required" and "Declaration is not allowed here". I tried to run my code online compiler but its not giving me these error there.
Can anyone help me with this ?
I hope it's due to C99 mode but not confirmed. TurboC++ 3.0 Supports C99 or not ?
Note: I can't share my code directly here due to project research work , If anyone want to have a look at my code I can send you via private message , Sorty for that
The error: Declaration Not allowed here
is due to the mixed type declaration of variables and the error: Constant Expression required
is because of the variable length arrays.
Mixed type variables and variable length arrays are are allowed in C99 and latter. Neither MSVC nor Turbo C++ supports C99.
I tried to run my code online compiler but its not giving me these error there.
This is because almost all new (and online) C compilers support C99.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments