I'm using this, but when I run it, and press a key other than Q or q, it gives me something like $qrii instead of like "You Pressed A", or something. Can someone tell me what I'm doing wrong? As you can see, I'm a complete newb, so any help is greatly appreciated.PHP Code://---------------------------------------------------------------------------
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
char cChar[1];
start:
clrscr();
printf("How ya doin?\nI'm doin fine.\n");
printf("Press Q or q to exit: ");
gets(cChar);
goto end;
end:
if(*cChar == 'Q' || *cChar == 'q')
{
return 0;
}
else
{
MessageBox(NULL, "You Pressed " + *cChar, "Test", MB_OK);
goto start;
}
}
//---------------------------------------------------------------------------




Reply With Quote