Reputation: 1645
I'm using Visual Studio 2012 to develop simple Win32 C programs. I know that the VS compiler only supports C89, but I'd like to know if there is a way to override this limitation.
In particular I'd like to declare variables anywhere in my code, instead of only at the beginning of scope blocks (as C89 requires).
Thanks in advance.
Upvotes: 12
Views: 15441
Reputation: 224
This seems like a dated thread, but having landed here first while I was searching for the same question I thought I should post an update:
As of VS13, the Visual C++ compiler supports C99 style variable declarations. More details here:
Upvotes: 9
Reputation: 169813
The choices I see:
Upvotes: 13
Reputation: 208
Build your app using the C++ compiler. This is the easiest way. You can still write C code just name the file *.cpp
Upvotes: -5