1 # Include <iostream>
2 Using Namespace STD;
3
4 Int Main ()
5 {
6 Const Int A [] = { 10 , 20 ,30 };
7 Const Int * P =;
8 Cout < " * P: " <* P <Endl;
9 Cout < " * P: " <* P < " \ T * P ++: " <* P ++ < " \ T * P " <* P <Endl;
10 Return 0 ;
11 }
12
13 /* Output:
14 * P: 10
15 * P: 20 * P ++: 10 * P: 10
*/
From the above example, we can see that the cout calculation order is from right to left. First, we can obtain the first element 10 by referencing * P, then, in the second output statement, from the right to the left, first obtain 10 for the solution reference, and then calculate * P ++. For the calculation of * P ++, see: for example, I = 3; cout <I ++ <Endl; Also outputs 3 because I is output first, and then the I value is changed. Output * P is 10 first, but after this formula is calculated, * p becomes 20 for the second element, that is, the first * P is 20, and the output is 10.