码迷,mamicode.com
首页 > 其他好文 > 详细

string.length() 返回值是unsigned

时间:2015-12-31 12:17:52      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

int main(int argc, const char * argv[]) {
    // insert code here...
    string a = "a";
    cout<<a.size()<<endl;
    cout<<a.size()-1<<endl; 
    cout<<a.length()<<endl;
    cout<<a.length()-1<<endl;
    
    return 0;
}

输出:

0

18446744073709551615

0

18446744073709551615

string.length() 返回值是unsigned

标签:

原文地址:http://www.cnblogs.com/XingyingLiu/p/5091283.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!