For Loops in C in Visual Studio 2008
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
For Loops in C in Visual Studio 2008
I prefer to be able to declare a loop variable in a for loop. Can this somehow be "enabled" in C for Visual Studio 2008?
Instead of having to declare i BEFORE the for loop.
Plus I don't like having loop variables needlessly available outside the actual loop.
Any way to make Visual Studio do this for C in say Microsoft Visual Studio C++ Express 2008?
(CodeBlocks + GCC lets me do with a C99 compiler flag; Clang/LLVM likewise allows this behavior in for loops.)
- Code: Select all
for (int i = 0; i < 10; i ++)
Instead of having to declare i BEFORE the for loop.
- Code: Select all
int i;
for (i = 0; i < 10; i ++)
Plus I don't like having loop variables needlessly available outside the actual loop.
Any way to make Visual Studio do this for C in say Microsoft Visual Studio C++ Express 2008?
(CodeBlocks + GCC lets me do with a C99 compiler flag; Clang/LLVM likewise allows this behavior in for loops.)
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: For Loops in C in Visual Studio 2008
MSVC doesn't support this C99 feature. 
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest