Mark wrote:
The following code works with gnu compilers (ISO compliant declaration of
the variable "i")
void foo()
{
for (int i = 0; i < length; i++) {
loop code....
}
for (int i = 0; i < length; i++) {
loop code....
}
}
However, the compiler in VC 6.0 complains:
error C2374 'i' : redefinition: multiple initialization...
What's up? Is there a switch I can set in the VC++ compiler to allow it to
accept these ISO compliant use if 'i'
Thanks in advance.
Mark
No. VC 6 predates some of the stds. It has the 'extension'
that once 'i' is defined it exists until the end of the function.
Larry
--
Anti-spam address, change each 'X' to '.' to reply directly.