string
时间:2010-06-08 来源:checl1987_EE
string 类简单应用
#include<stdio.h>
#include<string>
#include<iostream>
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; }
A = B; strcpy(a, A.c_str()); printf("A = %s\n", a); return 0; }
相关阅读 更多 +