用
system("命令字符串");
或 system(已给定命令内容的字符变量);
例如:
#include <stdio.h>
#include <stdlib.h>
void main()
{
char st[32]="a.exe"; // 已给定命令内容的字符变量
system("type a.c"); // 命令字符串,运行DOS命令TYPE
printf("I am running a.exe now!");
system(st); // 运行外部a.exe文件
}
温馨提示:答案为网友推荐,仅供参考