c語言調(diào)用api接口實(shí)例?
#include <windows.h>這樣就可以條用api文件了;如果只是關(guān)機(jī)的話下面的代碼你可以試試
#include<stdio.h>
#include<dos.h>
#include<stdlib.h>
void main()
{
char shut[8];
char b[81];
printf("Hello, Welcome to the TC automatic shutdown procedures\n");
printf(" Watermelon production\n");
printf("Please enter your desired automatic shutdown of time:");
scanf("%s",shut);
sprintf(b,"at %s shutdown -s",shut);
system(b);
}