"QQ" <ju****@yahoo.com> wrote:
For instance I have a struct
struct A{
char ID[10];
}A;
when I call the ID in struct A
You do not call an array. You call a function.
A aa;
is &aa.ID[0] and aa.ID
the same?
Depends on the context. Usually, yes, they are the same (or more
precisely, aa.ID is evaluated as if it were the same as &aa.ID[0]).
But for example, as the operand of sizeof, they're not the same: sizeof
&aa.ID[0] is equal to sizeof (char *), while sizeof aa.ID is equal to
10*sizeof char, i.e., to 10.
Richard