Array of structures?

Could somebody provide an example of an array of structures? I don't quite understand how to do one.
A struct or class is a user-defined type. Think of it like any other type, such as char or int or double.

1
2
3
4
5
6
7
8
9
10
11
12
13
struct Mystruct {
    // etc.
};

class Myclass {
    // etc.
};

int array1[10]; // array of 10 integers

Mystruct array2[10]; // array of 10 Mystructs

Myclass array3[10]; // array of 10 Myclasses  


See tutorial for more detailed examples,
http://www.cplusplus.com/doc/tutorial/structures/
Topic archived. No new replies allowed.