string.length() & strlen(char *)

c = "hello";	// type: char *
cout << strlen(c) << endl;

string s = "test";
cout << s.length() << endl; 

你可能感兴趣的