#include<list>
#include<iostream>
#include<vector>
using namespace std;
int main()
{
list<const char *> a = {"aaa","bbb","ccc"};
vector<string> b(a.cbegin(), a.cend());
for (const auto &c : a)
cout << c << " "; //此陳述句正常
for (const auto &c : b)
cout << c << " "; //此陳述句報錯,為什么
return 0;
}
uj5u.com熱心網友回復:
少了#include<string>
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/84631.html
標籤:基礎類
下一篇:C語言
