>Doug,
>
[quoted text clipped - 3 lines]
>For example:
>CString (*llv)[2] = new CString[2]; //Here fail right side
The expression:
new CString[2]
creates an array of two CStrings and returns a pointer to its first
element; this pointer has type CString*, as is the case for any array
CString[n]. So if your RHS is correct, you need:
CString* llv = new CString[2]; // Fine
On the other hand, if your LHS is correct, you're talking about a pointer
to an array of two CStrings, which is different, because the thing pointed
to is a CString[2], not a CString. Pointers to arrays come into play when
dealing with 2D arrays. For example:
CString (*llv)[2] = new CString[2][2]; // Fine
CString (*llv)[2] = new CString[3][2]; // Fine
CString (*llv)[2] = new CString[4][2]; // Fine
Here, new[] returns a pointer to the first element of an array
CString[m][2]. This element has the type CString[2], and so a pointer to it
has the type CString (*)[2].
In plain English, what type are you trying to create?

Signature
Doug Harrison
Visual C++ MVP
MilanB - 10 Jul 2006 07:19 GMT
Thanks Doug,
I have already solved my problem using your previous answer. I just was
experimenting, and was not sure about my second question ( could not found
answer on web and documentation, so I asked you)
Thanks again for your very, very usefull and precise answers.
Milan
> >Doug,
> >
[quoted text clipped - 28 lines]
>
> In plain English, what type are you trying to create?