From mboxrd@z Thu Jan 1 00:00:00 1970 From: Srinivasa T N Subject: Re: c++ code - not getting compiled !!!!!!!!! Date: Fri, 29 Jul 2011 12:14:43 +0530 Message-ID: <4E3256DB.50308@linux.vnet.ibm.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-c-programming-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: ratheesh kannoth Cc: =?ISO-2022-JP?B?IlN0ZXZlIEdyYWVnZXJ0ICgbJEIlOSVGJSMhPCVWGyhCKSI=?= , linux-c-programming@vger.kernel.org On 07/29/2011 11:56 AM, ratheesh kannoth wrote: > #include >>> >>> using namespace std; >>> >>> int main() >>> { >>> int i; >>> >>> cout<< "Enter value of i "<< endl; >>> cin>> i; >>> >>> if (i< 5) >>> goto Sri; >>> >>> int j = 6; Changing it to two lines will make it work: int j; j = 6; Regards, Seenu. >>> cout<< "j = "<< j<< endl; >>> >>> cout<< "Outside Sri"<< endl; >>> return 0; >>> >>> Sri: >>> cout<< "Inside Sri"<< endl; >>> return 0; >>> }