From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23763 invoked by alias); 24 Mar 2009 23:26:02 -0000 Received: (qmail 23755 invoked by uid 22791); 24 Mar 2009 23:26:01 -0000 X-SWARE-Spam-Status: No, hits=0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33,J_CHICKENPOX_71,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f165.google.com (HELO mail-fx0-f165.google.com) (209.85.220.165) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Mar 2009 23:25:55 +0000 Received: by fxm9 with SMTP id 9so2401303fxm.8 for ; Tue, 24 Mar 2009 16:25:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.166.208 with SMTP id c16mr181777hbe.102.1237937152061; Tue, 24 Mar 2009 16:25:52 -0700 (PDT) In-Reply-To: References: Date: Tue, 24 Mar 2009 23:26:00 -0000 Message-ID: Subject: Re: is there any way for exit(1) From: gfx art To: "John (Eljay) Love-Jensen" Cc: GCC-help Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-03/txt/msg00311.txt.bz2 Thank you very much for your reply.. but I get the same error List.cpp: In member function =91void List::erase(int)=92: List.cpp:68: error: =91exit=92 was not declared in this scope *********************** and this is my member function #include #include using namespace std; #include "List.h" void List::erase(int pos) { if (mySize =3D=3D 0) { cerr << "*** List is empty ***\n"; exit(1); // I can't use it } if (pos < 0 || pos >=3D mySize) { cerr << "Illegal location to delete -- " << pos << ". List unchanged. ***\n"; return; } // Shift array elements left to close the gap for(int i =3D pos; i < mySize; i++) myArray[i] =3D myArray[i + 1]; // Decrease list size mySize--; } Thank you very much for your time and I know how you help others in open source world Ali Mirza.. On Wed, Mar 25, 2009 at 12:49 AM, John (Eljay) Love-Jensen wrote: > Hi gfx art, > > Try this... > > #include > > if (mySize =3D=3D CAPACITY) > { > =A0=A0cerr << "No space" << endl; > =A0=A0std::exit(1) > } > > HTH, > --Eljay >