1.普通方法
#include<iostream>
#include<string>
using namespace std;
int howLong(string s1){
int m=s1.length();
return m;
}
int main(int argc,char* argv[]){
char aa[]="hijfasddasfasfasds";
string s1=aa;
int result=howLong(s1);
int result2=howLong(aa);//这个方法也行
cout<<"该字符串长度为1:"<<result<<endl;
cout<<"该字符串长度为2:"<<result2<<endl;
return 0;
}