The arrays can be used as data members and objects as well.
For example,
class student
in the above example, data members are name, regno, and fees are data members. The getdata() and printdata() are the members functions of the class student and obj is an array of objects of type class student. The for loop is used to pass value to data member for all the objects and another time for loop is used to print the data values of data members of the class.