Is there a C++ function to turn off the computer?

application-shutdown, c++, windows

Solution

On windows you can use the ExitWindows function described here:

http://msdn.microsoft.com/en-us/library/aa376868(VS.85).aspx

and here's a link to example code that does this:

http://msdn.microsoft.com/en-us/library/aa376871(VS.85).aspx

Problem

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++? Basically, what is the code to turn off a windows xp computer in c++?

Original source