国产宅男网站在线|亚洲A级性爱免费视频|亚洲中精品级在线|午夜福利AA毛

  • <dd id="gf5jf"><th id="gf5jf"></th></dd>

    <cite id="gf5jf"><label id="gf5jf"></label></cite>
  • <div id="gf5jf"><listing id="gf5jf"></listing></div>
    學(xué)習(xí)啦>學(xué)習(xí)電腦>電腦故障>電腦故障現(xiàn)象>自動重啟>

    c語言電腦重啟代碼

    時間: 楚煥725 分享

      c語言中的電腦重啟代碼,你知道多少?或許不是學(xué)IT的都不是很了解這個,或者說學(xué)IT的小白也都不是很了解這個代碼,那么下面就由學(xué)習(xí)啦小編帶你看看吧!

      c語言 電腦重啟代碼

      代碼步驟:

      system("shutdown -r");就是重啟命令

      #include

      int main (){

      system("shutdown -r");

      return 0;

      }

      1、system函數(shù):

      原型:int system(const char * command);

      功能:執(zhí)行 dos(windows系統(tǒng)) 或 shell(Linux/Unix系統(tǒng)) 命令,參數(shù)字符串command為命令名;

      說明:在windows系統(tǒng)中,system函數(shù)直接在控制臺調(diào)用一個command命令。在Linux/Unix系統(tǒng)中,system函數(shù)會調(diào)用fork函數(shù)產(chǎn)生子進(jìn)程,由子進(jìn)程來執(zhí)行command命令,命令執(zhí)行完后隨即返回原調(diào)用的進(jìn)程;

      頭文件:stdlib.h;

      返回值:命令執(zhí)行成功返回0,執(zhí)行失敗返回-1。

      2、例程:

      #include#includeint main(){system("del C:3.txt");//在控制臺中,執(zhí)行命令del C:3.txt,刪除C盤目錄下的123.txt文件return 0;}

    539110