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);
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);