字符串转换例程
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
void test2()
{
string s = "11112aaaa";
char ch[1024]={0};
int a = 52000;
double b = 1.1314;
string str;
ostringstream oss;
oss << s <<";"<< a << b;//将s、a、b写入oss流中
cout << oss.str() << endl;//打印oss中存储的string类型对象
str=oss.str();
str.copy(ch,str.length(),0);
int i=0;
while(i!=1023)
{
cout<<ch[i];
i=i+1;
//cout<<str.length()<<endl;
}
i=0;
}
int main()
{
test2();
return 0;
}