setsuspendstate() ... with hiberanting a computer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
#include <powrprof.h>
#include <std_lib_facilities.h>
#define new '\n'
using namespace std;
int choice;


int main ()
{
top:    
    cout << "Power Manager V1" << new;
    cout << "To Hibernate == 1" << new;
    cout << new;
    cout << "To power off == 2" << new;
    cout << new;
    cout << "To stand == 3" << new;
    cout << new;
    cout << "To restart == 4" << new;
    cout << new;
    cin >> choice;
         {
                  
if (choice == 1)
{  goto a1;
}

a1:
        BOOLEAN WINAPI SetSuspendState(
  __ true  BOOLEAN Hibernate,
  __ false  BOOLEAN ForceCritical,
  __ false  BOOLEAN DisableWakeEvent
);
keep_window_open();
return 0;
}
}

why wont this work
am i using it right???
i know im using goto wrong..

new is a keyword
what do u mean...
i needed help on the hibernating thing
#define new '\n' doesn't work.

new is a keyword.

Change it something like NEW / NEWLINE
visit this link[url=http://www.google.com]click here[/url]
aboutu i googled it extensively...
all i need is help not criticism
Last edited on
bluezor yes...
#define new '\n' does work i have used it before and it has worked
Well.. it is a bad habit to define a keyword as something else
can some one please not criticize me and just help me please...
can some one please not criticize me and just help me please...
Criticism is a form of help.

Here's an example of a valid call to SetSuspendState(): SetSuspendState(1,0,0);

#define new '\n'
This has to be one of the most retarded things I've ever seen. Do not do this. Ever. Besides, why 'new'? Why not #define nl '\n'? Not only it doesn't use a C++ keyword, it's also shorter and more descriptive.

i know im using goto wrong..
It's not that you're using it wrong; it's that you're using at all. Finish this program without using goto. You don't need it.
Topic archived. No new replies allowed.