string 类简单应用
#include
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
char *a = new char;
string A = "123";
string B = "456";
A += B;
cout << "A = " << A << endl;
A = B;
strcpy(a, A.c_str());
printf("A = %s\n", a);
return 0;
}
阅读(1789) | 评论(0) | 转发(0) |