SkTDArrayintArray; intArray.push_back(1); intArray.push_back(2); intArray.push_back(3); int numElements = intArray.count(); // numElements is now 3
SkTDArrayIn both examples, we create a SkTDArray of a certain type, push some elements into it, and then call the count method to get the number of elements. We can see that SkTDArray is part of the Skia Graphics Engine library, which is available as a package on various platforms, including Ubuntu, macOS, and Windows.pointArray; pointArray.push_back({0, 0}); pointArray.push_back({1, 1}); pointArray.push_back({2, 2}); int numPoints = pointArray.count(); // numPoints is now 3