string类的格式
 
string a;
如下图,使用string类比常规的字符串处理方便很多
 而且需要进行的字符串处理,在类中都能完成
 
#include "iostream"
using namespace std;
extern "C"
{
    #include "string.h"
}
int main()
{
    //c的写法
    char a[10]={0};
    strcpy(a,"hello world");
    cout << a << endl;
    //c++扩充的写法
    string b;
    b="10086";
    cout << b << endl;
}



















