向system 命令行中添加变量
#include<iostream>
#include<fstream>
#include<string>
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
char file[256];
sprintf(file, "rm -rf %s ", "123.txt");
system(file);
//sprintf(file, "move %s 123.txt", "Log.txt");
sprintf(file, "rename %s 123.txt", "Log.txt");
system(file);

浙公网安备 33010602011771号