Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (anonymous):

C++: I have a class with items of different types (ints, strings). I'm stuck on creating an array of these objects... would I have to create different arrays for each object in the class or can I create one array that holds all of the information for each class?

OpenStudy (anonymous):

creating an array of objects is easy :)

OpenStudy (anonymous):

for instance say I have a class like myClass: myClass[] objs = new myClass[5](); I believe this is valid, try it and let me know.

OpenStudy (anonymous):

Google is your friend: http://www.java2s.com/Tutorial/Cpp/0180__Class/Createanarrayofobjects.htm

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!