CArraymyArray; // create an empty integer array int size = myArray.GetSize(); // returns 0
CArrayIn this example, we create a float array using the CArray template class and add two elements to it using the Add() method. We then use the GetSize() method to return the size of the array, which is two. Package library: Microsoft Foundation Classes (MFC) library of C++.myArray; myArray.Add(1.0f); myArray.Add(2.0f); int size = myArray.GetSize(); // returns 2