Use code system to execute terminal commands in C language program (Linux system)

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

    return 0;
}

In the linux system, after we write the program, we need to restart the system, using system("terminal command");

The terminal command can be replaced with other commands, such as the IP address.

Guess you like

Origin blog.csdn.net/modi000/article/details/113857332