C arrays are not types. They are pretty low level, raw things in c++. They are a block of memory that is allocated on a sizeof(type) basis for each location.

You can wrap them in types in a variety of ways, but we need to know what you want for that.

are you asking multiple dimensions?
int x[3][5]; //3 rows, 5 columns each array of integer.

or a type with multiple arrays?
struct meh
{
int x[10];
int y[10];
}; //a very simple type with 2 arrays.

most coders prefer the vector object as a high level array replacement.

that looks like vector<int>x; //a vector of integers.
or vector<int>x(10); //x has 10 locations usable at construction time.
or vector<vector<int> > x; //2-d vector.

Last edited on
The OP has since been removed, but the original question was some nonsense like

"How do I declare an array type with multiple arrays?"
Last edited on
int[10] is very much a type, though.
Yes, that is true: I was wrong to say its not a type. It absolutely behaves exactly like all other types with 2 exceptions... using it is split (int x[10] rather than int[10] x though I believe both work, you don't see much of the second) and it requires a type itself (the int part).
Its the requirement of another type (the int part again) that had me thinking its not of itself a true/pure type. But as you said, it absolutely is a type in spite of that oddity.
Topic archived. No new replies allowed.