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

posted @ 2021-06-24 09:29  江南王小帅  阅读(153)  评论(0)    收藏  举报