Code:
#include <windows.h>
#include <iostream>
using namespace std ;
char GetInput()
{
HANDLE input=GetStdHandle(STD_INPUT_HANDLE) ;
LPDWORD length ;
INPUT_RECORD record ;
char ToReturn ;
while (record.Event.KeyEvent.bKeyDown)
{
ReadConsoleInput(input,&record,1,length) ;
ToReturn= record.Event.KeyEvent.uChar.AsciiChar ;
}
return ToReturn ;
}
//now whenever testing the function:
int main()
{
string Letter_A="Amazing addition to my function collection really works" ;
if (GetInput()=='a')
cout<<Letter_A ;
else
cout<<"You either didn't enter \"a, or Garland tried to fool me! " ;
cin.get();
return 0 ;
}
Indented and looks SO much better.
Even if you're posting a sample, please INDENT the code, because otherwise it's almost unreadable - like your previous example was.
It's not too much to ask of you to actually indent your code, is it? That's all I ask.
(Not criticizing your post nor your code - just your indentation.)