use of ++i, i++
From: Greenhorn (teachgreenhorn_at_yahoo.com)
Date: 02/26/05
- Next message: Ben Pfaff: "Re: use of ++i, i++"
- Previous message: Greenhorn: "Re: where does cc send the output by default"
- Next in thread: Ben Pfaff: "Re: use of ++i, i++"
- Reply: Ben Pfaff: "Re: use of ++i, i++"
- Reply: Richard Cavell: "Re: use of ++i, i++"
- Reply: DHOLLINGSWORTH2: "Re: use of ++i, i++"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Feb 2005 11:28:18 -0800
hi,
From reading some guides i understood that prefix, postfix operate
this way, former executes the increment right away, latter executes the
increment after the immediately after the immediately following end of
statement. Is that correct ?
If i go by that rule, the below two statements are equivalent
for(i=0;i < 1;i++)
printf("The first value printed for i is %d", i);
for(i=0;i < 1;++i)
printf("The first value printed for i is %d", i);
The outputs are same here as printf(...) statement above is the
immediately following end of the first statement after the 'increment
operator(s)'
Thanks in advance.
greenhorn.
- Next message: Ben Pfaff: "Re: use of ++i, i++"
- Previous message: Greenhorn: "Re: where does cc send the output by default"
- Next in thread: Ben Pfaff: "Re: use of ++i, i++"
- Reply: Ben Pfaff: "Re: use of ++i, i++"
- Reply: Richard Cavell: "Re: use of ++i, i++"
- Reply: DHOLLINGSWORTH2: "Re: use of ++i, i++"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|