C++调用系统命令
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
main()
{
char file1[15];
char file2[16]=" ";//一个空格
char copycmd[50]="copy ";
char plotcmd[80]="wgnuplot.exe C:\\mytest\\diagram.txt";
// printf("input first name\n");
// scanf("%s",file1);
// printf("input first name\n");
// scanf("%s",file2+1);
// strcat(copycmd,file1);
// strcat(copycmd,file2);
// printf("%s\n",copycmd);
//char cmds[20]="diagram.txt"
//strcat(plotcmd,)
printf("%s\n",plotcmd);
system(plotcmd);
}
#include <string.h>
#include <stdlib.h>
main()
{
char file1[15];
char file2[16]=" ";//一个空格
char copycmd[50]="copy ";
char plotcmd[80]="wgnuplot.exe C:\\mytest\\diagram.txt";
// printf("input first name\n");
// scanf("%s",file1);
// printf("input first name\n");
// scanf("%s",file2+1);
// strcat(copycmd,file1);
// strcat(copycmd,file2);
// printf("%s\n",copycmd);
//char cmds[20]="diagram.txt"
//strcat(plotcmd,)
printf("%s\n",plotcmd);
system(plotcmd);
}