C++的 striing 类中 ,  size()成员函数的返回类型为   string::size_type  , 为了程序的可移植性 , 避免用其他类型来代替该类型

1 string      str("hahahahha");
2 string::size_type len = str.size();
3 cout<<len<<endl;

 

posted on 2013-06-08 14:50  wowk  阅读(232)  评论(0编辑  收藏  举报