P
Paul
Leigh Johnston said:Maybe the following will help you understand the semantic differences
involved:
int main()
{
int* p1 = new int[42]; // 'p1' is a pointer to the first element of an
array
int (*p2)[42] = new int[1][42]; // 'p2' is a pointer to an array
}
This is a clear indication of how screwed up you are. Please read the
following :
"the newexpression yields a pointer to the initial element (if any)
of the
array. [Note: both new int and new int[10] have type int* and the type
of new int[10] is
int (*)[10]. ]"
The standards define both of these types to be pointers to the array,
they are just different *types* of pointer.
No; for the final time: int* is not a pointer to an array; int* is a
pointer to a scalar; the Standard clearly states "the new-expression
yields a pointer to the initial element (if any) of the array"; it
doesn't state that "the new-expression yields a pointer to the array".
Err no your nonsense is becoming beyond belief .
A pointer to the first element *IS* a pointer to the array.
The standards states clearly that both int* and int(*)[10] are pointers
to the first element. There is no difference in what these pointers
point to. You must think int(*)[10] is an array of pointers or something
, *shakes head* no I don't know what nonsense you think.
Yes everything seems like nonsense to you as you are either unable or
unwilling to be get a firm technical grasp on C++ matters.
PROVEN WRONG!