QString,char,string之间赋值

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

1)QString赋值给char *

    QString q_str;

    char *str = q_str.toLatin1().data();


2)char [] 赋值给string

    char str[20];

    string str1(str);


3)char *赋值给QString

    char *str;

    QString q_str;

    q_str += str;


转载于:https://my.oschina.net/u/2311935/blog/373408

你可能感兴趣的:(QString,char,string之间赋值)