Thread
:
c++ unary operators
View Single Post
07-29-2000, 08:46 AM
#
3
toji
Member (5 bit)
Join Date: Jul 2000
Posts: 16
int i=5,j;
j=i++ + ++i;
cout<
will display 12,7
Unary operators have precedence over + operator. Then,
why doesn't the assignment part of i++ (i.e. assigning
i+1 to i) take place before the addition?
Why
int i=5;
cout<
shows 6,6 ?
'am lost!
toji
View Public Profile
Find More Posts by toji