CArrayarr; arr.SetSize(3); arr[0] = 10; arr[1] = 20; arr[2] = 30; int element = arr.GetAt(1); // returns 20
CArrayIn this example, we create an instance of the CArray class containing characters, add three elements to it, and then use the GetAt function to retrieve the element at index 2 (which is the third and last element in this case). The returned value is stored in the 'element' variable.arr; arr.Add('a'); arr.Add('b'); arr.Add('c'); char element = arr.GetAt(2); // returns 'c'