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

后端 未结 6 2195
悲&欢浪女
悲&欢浪女 2020-12-30 16:51

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++?

6条回答
  •  生来不讨喜
    2020-12-30 17:31

    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

提交回复
热议问题