The arrays can be used as data members and objects as well. For example,
in the above example, data members are name, Regno, and fees are data members. The getdata() and printdataQ 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 members. for all the objects and another time for loop is used to print the data values of data members of the class.