From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,dab7d920e4340f12 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public From: David Morton Subject: Re: C is 'better' than Ada because... Date: 1996/06/22 Message-ID: <31CC75C1.5BF2AF6A@jinx.sckans.edu>#1/1 X-Deja-AN: 161619289 references: <4q8fbo$701@red.interact.net.au> content-type: text/plain; charset=us-ascii organization: student mime-version: 1.0 newsgroups: comp.lang.c,comp.lang.ada x-mailer: Mozilla 3.0b4Gold (X11; I; Linux 2.0.0 i486) Date: 1996-06-22T00:00:00+00:00 List-Id: > > ======= the C program > > #include > main() > { > int vec[5]; > int i; > > for(i = 0 ; i < 10 ; i++ ) > { > vec[i] = i; > cout<< " current value is " << vec[i] << endl; > } > > } > > $CC test1.cc > $a.out > current value is 0 > current value is 1 > current value is 2 > current value is 3 > current value is 4 > current value is 5 <--- Nice !! C/C++ allows me to the freedom to loop > current value is 6 I dont have to change my code :) > current value is 7 > current value is 8 > current value is 9 > > Nasser > -- > Nasser Abbasi. C/C++/Ada Solaris. GeneAssist - A client/server application > for Nucleic acid and protein sequence search and analysis. > PE-Applied BioSystem division. email: nasser@apldbio.com > MSEE(control), MSCS, MSCE, FM(Fide Chess Master 2305 ELO 1.e4 !!) I get: current value is 0 current value is 1 current value is 2 current value is 3 current value is 4 current value is 5 current value is 6 current value is 7 current value is 8 current value is 9 Segmentation fault so that c code *will* have to be changed... But I am curious why it did seg fault sooner? (BTW, That's why I'm posting this back to comp.lang.c) Can anyone tell me why this doesn't seg fault sooner? OS is Linux 2.0, GNU g++ -- David Morton mailto:dmorton@jinx.sckans.edu // If you use Netscape 2.0, 205 College, Winfield, KS 67156 // you can click on the mailto: part to reply! (HINT, HINT) :)