Re: c++ code - not getting compiled !!!!!!!!!

ratheesh kannoth <[email protected]> Fri, 29 Jul 2011 11:56:07 +0530
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <CAGZFCEGO2JipOu=MeHTjau1ocXa_r483bfL5ViBiXmhAT3m1hw@mail.gmail.com>
g++ 2.cpp
2.cpp: In function 'int main()':
2.cpp:21: error: jump to label 'Sri'
2.cpp:13: error:   from here
2.cpp:15: error:   crosses initialization of 'int j'





2011/7/29 Steve Graegert () <[email protected]>:
> Is it too much to ask for the actual error returned by the compiler?
>
>
> On Fri, Jul 29, 2011 at 08:01, ratheesh kannoth <[email protected]> wrote:
>> #include <iostream>
>>
>> using namespace std;
>>
>> int main()
>> {
>>    int i;
>>
>>    cout << "Enter value of i " << endl;
>>    cin >> i;
>>
>>    if (i < 5)
>>        goto Sri;
>>
>>    int j = 6;
>>    cout << "j = " << j << endl;
>>
>>    cout << "Outside Sri" << endl;
>>    return 0;
>>
>> Sri:
>>    cout << "Inside Sri" << endl;
>>    return 0;
>> }
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>> the body of a message to [email protected]
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>