output help!!

1
2
3
4
double y, z;
double c[4]= {3.5, -0.6, 4.7, 5.7 };
y= c[1];
z= c[2]*y++;



why is y=.4 instead of -0.6?
Last edited on
closed account (zb0S216C)
The values specified within the braces are the initializing values of c's elements. I tend to call them initialization lists. For example:

1
2
3
4
5
6
int Numbers[3] = 
{
    0, // Element No. 1
    1, // Element No. 2
    2  // Element No. 3
};

Wazzak
Last edited on
when i compile and run,
i get y=.4 and z=-2.82
closed account (zb0S216C)
Are those unexpected results?

Wazzak
Scroll down this link and read about pre increment and post increment operators
http://www.cplusplus.com/doc/tutorial/operators/
Topic archived. No new replies allowed.