system 库函数
作用
- 在程序中启动另一个程序
参数:要的是待启动程序的路径名
- win平台写路径的时候 用
// 或者 \
c#include <stdio.h>
#include <stdlib.h>
int main()
{
system("C:/Users/Administrator/Desktop/c++13/hello.exe");
printf("hello worldfbahfoahfoooooooooooooooooooooo\n");
return 0;
}
详解
#include <stdlib.h>
int system(const char *command);
功能:在已经运行的程序中执行另外一个外部程序
参数:外部可执行程序名字
返回值:
成功:0
失败:任意数字
示例代码
#include <stdio.h>
#include <stdlib.h>
int main()
{
system("ls");
return 0;
}
自己尝试代码
#include <stdio.h>
#include <stdint.h>
int main()
{
system("d://cpp//hello.exe");
printf("hello world\n");
return 0;
}