missing template arguments before异常解决

target.cpp:10:12: error: missing template arguments before 'msg'
     vector msg {"people", "cat", "dog", "chair", "cup"};
            ^~~
target.cpp:12:31: error: 'msg' was not declared in this scope
     for (const string& word : msg)

 

正确的写法:

vector msg {"people", "cat", "dog", "chair", "cup"};

改为:

vector msg {"people", "cat", "dog", "chair", "cup"};

你可能感兴趣的:(C++,错误提醒)