MemoryGarden's Blog

努力 -----------大能猫

C++博客 首页 新随笔 联系 聚合 管理
  118 Posts :: 11 Stories :: 20 Comments :: 0 Trackbacks

公告

嵩哥,我想你了。

随笔分类(102)

随笔档案(118)

文章分类(10)

文章档案(11)

相册

友情链接

搜索

最新评论

阅读排行榜

string::begin

Returns an iterator referring to the first character in the string.


1       iterator begin();
2 const_iterator begin() const;




 1 // string::begin and string::end
 2 #include <iostream>
 3 #include <string>
 4 using namespace std;
 5 
 6 int main ()
 7 {
 8   string str ("Test string");
 9   string::iterator it;
10   for ( it=str.begin() ; it < str.end(); it++ )
11     cout << *it;
12   return 0;
13 }


posted on 2009-12-28 02:00 memorygarden 阅读(319) 评论(0)  编辑 收藏 引用 所属分类: STL
51La