0

In general the type of a C++ array can be written as

std::array<T, Size>

What happens if my array happens to be a 3x3 array like this:

std::array<int> a[3][3];

How would the type here look like? I have tried:

std::array<int,3,3> or std::array<int, (3,3)>

But the compiler doesn't like that.

Quasar
  • 275
  • 1
  • 12
  • `std::array a[3][3];` this won't compile you need to provide the size – Killzone Kid Mar 15 '18 at 11:17
  • You seem to be confusing C style arrays with std::array. If you want a multidimensional array in C++, you can either do it in C style by saying `int a[3][3]` or use std::array and say `std::array, 3> a`. – lakshayg Mar 15 '18 at 11:21
  • @LakshayGarg What would the type of the C style array be? – Quasar Mar 15 '18 at 11:26
  • Do you mean to ask the type of `a` in `int a[3][3]`? If so, then the type of `a` is `int[3][3]`. – lakshayg Mar 15 '18 at 11:31

1 Answers1

-1

I'd guess that the type of your variable would be:

std::array< std::array<int,3>, 3 >
Axel Paccalin
  • 126
  • 1
  • 13