system 命令中使用变量

string CopyCMD = "copy MAC.bin ";
char CMD_CHAR[100];
CopyCMD.append(Mac + ".bin"); // s1 = "123abc"

strcpy_s(CMD_CHAR, CopyCMD.c_str());//strncpy(buf, str.c_str(), 10);
system(CMD_CHAR);

posted @ 2021-08-20 16:21  江南王小帅  阅读(190)  评论(0)    收藏  举报