system函数只有一个参数!
/////////////////////////////////////////
// C-Free 4.1
// MinGW 3.4.5
// veket的小号
/////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int time = 60;
char str[100] = "shutdown -s -t ";
sprintf(str+strlen(str), "%d\0", time);
printf("用system函数调用shutdown命令倒计时关机\n");
printf("解除方法:打开cmd 输入命令shutdown -a\n");
system(str);
return 0;
}
温馨提示:答案为网友推荐,仅供参考