Is there a C++ function to turn off the computer? And since I doubt there is one (in the standard library, at least), what\'s the windows function that I can call from C++?
You can shutdown by utilizing the system() function.
for Windows
system("shutdown -s");
for Linux
system("poweroff");
or
system("init 0");