以文本方式查看主题 - 计算机科学论坛 (http://bbs.xml.org.cn/index.asp) -- 『 C/C++编程思想 』 (http://bbs.xml.org.cn/list.asp?boardid=61) ---- 请教vector使用中遇到的俩个错误! (http://bbs.xml.org.cn/dispbbs.asp?boardid=61&rootid=&id=30456) |
-- 作者:jdsun -- 发布时间:4/12/2006 9:20:00 PM -- 请教vector使用中遇到的俩个错误! #include<iostream.h> #include<vector> #include<string.h> using namespace std; using std:: vector; void main ()
|
-- 作者:elfstone -- 发布时间:4/13/2006 9:08:00 AM -- #include "iostream" #include "vector" #include "string" using namespace std; int main () { string word; vector <string> text ; cout<<"please input some words:"<<endl; getline(cin,word); while(word!="") { text.push_back(word); getline(cin,word); } for(int i=0;i<text.size();i++) cout<<text[i]<<endl; system("PAUSE"); return 0; } |
-- 作者:elfstone -- 发布时间:4/13/2006 9:09:00 AM -- 注意头文件的声明方式。。。 |
-- 作者:jdsun -- 发布时间:4/14/2006 9:14:00 AM -- 谢谢指教! |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
62.500ms |