C++中在双引号里面使用变量

2024-12-02 20:40:01
推荐回答(2个)
回答1:

char s[100];
char* str = "C://xxx";
int data = 10;
sprintf(s, "val1 is %s val2 is %d.", str, data);

回答2:

QString imgpath = path.tostring();