C++/explain

Advertisement


Question
Would you mind explain the "array of objects" for me?

Thanks!

Answer
It is very similar to array of normal data types. You remember that for integers you define arrays like:

int myArray[10];

now if you have defined an object type like:

class myObject{
....
};

you can define an array of that object as:

myObject myArray[10];

Remember that with that type of objects, you sometimes neet to use pointers like:

myObject *myArray[10];

Hope this helps.

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Sam

Expertise

You may ask me about simple to complicated C/C++ programming methods/style and most like questions about network programming in C++.

Experience

I'm a professional programer in C++ and network/internet programming.

©2016 About.com. All rights reserved.