Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
683 views
in Computer by (49.7k points)

Illustrate with an example of how an array of objects can be defined.

1 Answer

+1 vote
by (49.6k points)
selected by
 
Best answer

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.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...