jeudi 5 novembre 2020

How to declare a vector of n strings in a class in C++ 11

class abc
{
   public:
          std::vector<std::string> other_license_files(30);
};

This should declare a vector of 30 elements, each an empty string. But i get the error expected ',' or '...' before numeric constant.

C++ primer doesn't say about using this within a class though in pg 98. Suppose this would be alright from a function. I don't know where else this information could be.

Aucun commentaire:

Enregistrer un commentaire