vendredi 2 décembre 2016

Create a fixed size 3D array of strings in c++?

To create an array of strings, I can do:

#include <string>
#include <vector>
...

std::vector<std::string> mylist;

But what if I want a fixed sized 3D array? ie, mylist[10][20][30]?

I tried:

std::vector<std::vector<std::vector<std::string>>> mylist(10)(20)(30);

But this is throwing many compile errors with ( being a wrong token.

Aucun commentaire:

Enregistrer un commentaire