我有这样的代码
string xml_path(conf("CONFIG"));
xml_path+=FILE_NAME;
Run Code Online (Sandbox Code Playgroud)
其中,conf函数返回char *和FILE名称是const char *
我想将它组合成一行
xml_path(conf("CONFIG")).append(FILE_NAME)
Run Code Online (Sandbox Code Playgroud)
我该怎么做?
有什么建议 ??
问题要求一行:
string xml_path = string(conf("CONFIG")) + string(FILE_NAME);
Run Code Online (Sandbox Code Playgroud)
(我假设xml_path是变量的名称,而不是我不知道的库中的某种调用).