When I write this code into my c++ compiler (dev c++) it gives me errors:
expected primary-expression before "char"
expected `;' before "char"
`ch' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
error: expected `)' before "break"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
char far *ch=(char far*)0x417;
printf("Press CTRL+ALT+LeftSHIFT to exit");
I don't know what to do and what is even wrong.
The program should close when i press ctrl+alt+shift.
HERE IS THE TEXT FROM THE WEBPAGE:
The bits of the byte 0x417 keep track of the status of the keys whereas the bits of the byte 0x418 only monitor whether the keys are pressed or not.
Now that we know how the keyboard stores information in memory, we can make our own keyboard shortcuts. We want to make a shortcut CTRL+ALT+SHIFT. This shortcut does not exist. We will write a program where, CTRL+ALT+LeftSHIFT will be used to quit the program. In the program, we will continuously monitor the address 0x417 and will see when the bits 1,2,3 are set(i.e. become 1) all at once. Below is the program:-