こんにちは、私は C++ の初心者です。コードが本でコピーされていても、{} を使用してベクターを初期化することはできません。たとえば、私がこれらを行うとき
vector <string> articles {"a", "an", "the"};
と
vector <string> articles = {"a", "an", "the"};
これらのエラーメッセージをそれぞれ受け取りました:
Error: expected a ";"
と
Error: initialization with "{...}" is not allowed for object of type "std::vector<std::string, std::allocator<std::string>>"
誰か助けてくれませんか?私が見つけることができなかったのは単純な間違いであるべきだと思います。