C++ : in trouble

can anyone please tell me the meaning of this :

w[ j++] = s ?

does it mean :
A) j++;
w[j]=s

or

B) w[j]=s;
j++;

??????????????

PLEASE HELP.............TOMORROW EXAM !!

6 Answers

6
Kalyan IIT-K Beware I'm coming ·

avvek eta ki re??m goin to fail tmrw........wat's d question??

1
Great Dreams ·

answer is B ?

39
Pritish Chakraborty ·

Yeah j++ is post increment. It should be B. Post increment is evaluated after expression is evaluated.

Aveek, why don't you do a dry run on Turbo C++ and see for yourself? :)

1
Great Dreams ·

use ++j for immediate increse or else it will increment after the end of loop .

1
tapan ·

ya its B.
the value of j will be used and incrementation is done after the statement,as pritish said

1
Tapas Gandhi ·

B
agreed wid pritish

Your Answer