Re: error C2374: 'i' : redefinition; multiple initialization

Discussion in 'C++' started by hacminhphuc@gmail.com, May 20, 2014.

  1. Guest

    On Tuesday, July 2, 2002 5:20:13 PM UTC+7, Bonio Lopez wrote:
    > Hi,
    > MSVC gives the compilation error on this:
    > for (int i=0; i<=6; i++)
    > {
    > ...
    > };
    > for (int i=0; i<6; ++i)
    > {
    > ..
    > };
    >
    >
    > error C2374: 'i' : redefinition; multiple initialization
    > c:\programme\edit\tests\tests.cpp(27) : see declaration of 'i'
    > Error executing cl.exe.
    >
    >
    > I thougth the for has its own scope?
    > Do you know the reaseon of the problem?


    You try with following command:
    int i;
    for ( i=0; i<=6; i++)
    {
    ...
    };
    for ( i=0; i<6; ++i)
    {
    ..
    };
    I hope it work !
     
    , May 20, 2014
    #1
    1. Advertisements

  2. Ian Collins Guest

    wrote:
    > On Tuesday, July 2, 2002 5:20:13 PM UTC+7, Bonio Lopez wrote:


    Definitely the record for the oldest post responded to here!

    --
    Ian Collins
     
    Ian Collins, May 20, 2014
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. A
    Replies:
    1
    Views:
    759
    Josephine Schafer
    Oct 22, 2003
  2. cody

    Redefinition Error

    cody, Sep 18, 2005, in forum: C++
    Replies:
    3
    Views:
    704
  3. junaidnaseer
    Replies:
    4
    Views:
    1,149
    junaidnaseer
    May 9, 2006
  4. Robbie Hatley
    Replies:
    0
    Views:
    636
    Robbie Hatley
    Jun 28, 2006
  5. Robbie Hatley
    Replies:
    1
    Views:
    813
    Victor Bazarov
    Jun 28, 2006
  6. Robbie Hatley
    Replies:
    2
    Views:
    984
    Ian Collins
    Jun 29, 2006
  7. aspineux
    Replies:
    5
    Views:
    793
    Paddy
    Mar 30, 2007
  8. Replies:
    4
    Views:
    4,081
    James Kanze
    Aug 5, 2008
Loading...