Fw: Re: thanks for the advice, and spaceship

k i r s t i n kirstinc@stanford.edu
Tue, 13 May 2003 23:00:30 -0700 (PDT)


let me take everything back until i have finally slept for hte first time
in about five days.
-K


On Tue, 13 May 2003, Hiroko Terasawa wrote:

>
> Hi Jeffyb and his funny companies,
>
> I tried a short script, and works ok. Both shows output of 01234.
> I was not sure if the preincrement might show output of 12345.
>
> When does for loop execute the i++ or ++i statement, before or after
> execution of the {} contents? The reason why people appreciate i++
> rather than ++i might be traditional? The old days when there were too
> many confusing languages (like fortran), it might have been possible
> that the following code come up with 12345.
>
> I have Karnighan book with bunch of i++, by the way.
>
>
> #include <iostream.h>
> int main(){
>   int i;
>   cout << "preincrement" << endl;
>   for(i=0; i<5 ; ++i){
>     cout << i << endl;  }
>   cout << "postincrement" << endl;
>   for(i=0; i<5 ; i++){
>     cout << i << endl;  }
>   return 0;
> }
>
>
>
> --
> Hiroko Shiraiwa-Terasawa <Hiroko.Terasawa@stanford.edu>
>
> _______________________________________________
> mamst mailing list
> mamst@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/mamst
>