Code:/-------------------------------------------------- #include <stdio.h> //printf() #include <conio.h> //getch() //--------------------------------------------------- int getKeyCode(void); // This function detects if // any key was pressed. //--------------------------------------------------- int main() { int iletter; printf (" Please press any key to continue\n"); while(1) { iletter = getKeyCode(); if (iletter != -1) { printf( "The letter pressed is %d\n",iletter); printf (" Please press any key to continue\n"); } } return 0; }//end main // following is the function getKeycode int getKeyCode(void) // function header { int keypress,letter,letterSecond; int value ; keypress = kbhit(); if(keypress != 0) { letter = getch(); if((letter == 0x0) || (letter ==0xE0)) { letterSecond = getch(); letterSecond <<= 8; value = (letter | letterSecond); } } else value = -1; return value; }// end getKeyCode
the error message i get is as follow
Run-Time Check Failure #3 - The variable 'value' is being used without being initialized.