Carray:: GetData() Return Value

I am confused about the return value of the function GetData() in Carray.
1
2
const TYPE* GetData( ) const; 
TYPE* GetData( );


From the page:
http://msdn.microsoft.com/en-us/library/yzsdcs85.aspx

Return Value:
A pointer to an array element.

Is it a pointer to entire array or a pointer to first element of the array?
Thanks.
Last edited on
The docs are not very clear but I'm sure it has to be a pointer to the first element in the array.
Hi,
So, I am wondering why there is a type casting here.

1
2
3
4
5
6
7
CArray<CPoint,CPoint> myArray;

// Allocate memory for at least 32 elements.
myArray.SetSize(32, 128);

// Add elements to the array.
CPoint* pPt = (CPoint*) myArray.GetData();
I don't know why they use a cast. It looks totally unnecessary.
Topic archived. No new replies allowed.