大家好, 我的问题是,如何将两个 C 风格的字符串 append 到一个字符串中?
我对 C++ 的处理方式 (std::string) 很感兴趣,我从未接触过 C 风格的字符串,需要为我当前的开发项目了解更多关于它们的信息。例如:
char[] filename = "picture.png";
char[] directory = "/rd/";
//how would I "add" together directory and filename into one char[]?
提前致谢。
最佳答案
使用 strcat()
。
参见此处:http://www.cplusplus.com/reference/clibrary/cstring/strcat/
关于c++ - 操纵 C 风格的字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4251419/