// 轉化成c風格
string str1(“hello world”);
const char *c_str1=str1.c_str();
//轉化成數組
const char *a_str1=0;
a_str1=str1.data();
[工作點滴] VisualC string轉成const char
string str1('hello world');
// 轉化成c風格
string str1(“hello world”);
const char *c_str1=str1.c_str();
//轉化成數組
const char *a_str1=0;
a_str1=str1.data();
Comments & Feedback