Hi

K&R II says
Code:
If the type of an expression or subexpression is ``array of T,'' for some type T, then the
 value of the expression is a pointer to the first object in the array, and the type of the 
expression is altered to ``pointer to T.'' This conversion does not take place if the 
expression is in the operand of the unary & operator, or of ++, --, sizeof, or as the left 
operand of an assignment operator or the . operator. Similarly, an expression of type 
``function returning T,'' except when used as the operand of the & operator, is 
converted to ``pointer to function returning T.''
I wonder why C needs to do this conversion for "array of T" and "function returning T". For the array operator [], the required syntax is "pointer to T"[intergral type]. I think the operator [] demands the conversion: "array of T" -> "pointer to T". But in other cases, it seems there is no need to do this conversion, like passing an array to a function. Still, a pointer is passed.

Furthermore, K&R tells the conversion doesn't take place for some operators. I still try to figure out why. I got some ideas but can't confirm: ++, -- and all assignment operators all generate "side effects" while array is not a modifiable lvalue. The dot operator requires a structure or union as its first operand. So it's "array of T" which doesn't fit in the operand requirement, and it has nothing to do with pointer conversion. & and sizeof require "pointer to an array" and "size of an array " respectively, not "pointer to a pointer" and "size of a pointer". So it's a semantic issue here. My point is pointer conversion seems a default action in a C program, with some exceptions. When "array of T" can participate in some operation, it will participate in the type "pointer to T". I need a direction to understand this mechanism. Can anyone help?

Thanks in advance!