string转CString

struct file  
{  
int id;
        string name;
int pid;
};

vector<file> file_to_vector; 

string str;
str = file_to_vector[0].name;
CString cstr;
cstr.Format ("%s",str.c_str());


cout << str << endl;
cout << "HELLO" << endl;
cout << cstr << endl;

cout << "HELLO" << endl;

输出:

A

HELLO

A

HELLO


阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页