// 结论: s.size() == s.length() // 前者为了兼容 STL // 后者为了兼容 c // test #include<bits/stdc++.h> using namespace std; int main() { string s="1234"; printf("%d\n",s.size()==s.length() ); // 输出: 1 return 0; }