Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

MSVC broken?

I thought this was valid C++:
    for (int i=0; ... ; ...) {
       ...
    }
    for (int i=0; ... ; ...) {
       ...
    }
    
I thought i went out of scope after the for block, yet MSVC says "error C2374: 'i' : redefinition; multiple initialization". Is Microsoft's compiler broken or do I not understand this correctly?
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 9 comments