c语言中程序中使用代码system执行终端命令(linux系统)

int main()
{
    //do sth.
    system("shutdown");

    return 0;
}

linux系统中,我们编写程序后,需要重启系统,使用system("终端命令");

终端命令可以替换为其他的命令,比如该IP地址等。

猜你喜欢

转载自blog.csdn.net/modi000/article/details/113857332