Add iostream header file and change stdio to cstdio.#include <iostream>#include <string>#include <vector>#include <cstdio>using namespace std;int main(){ vector<string> data={"Hello World!","Goodbye World!"}; for (vector<string>::iterator t=data.begin(); t!=data.end(); ++t) { cout<<*t<<endl; } return 0;} 这篇关于c ++ 遍历字符串向量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-18 04:25
查看更多