just wondering how to do this code, because i have 2 if statements in different functions, one says to do one thing if it gets left arrow, other one does something different when left arrow is it.
code:
void function1 ()
{
key=getch();
if(key==KEY_LEFT) //already declared key left before
printf("item one");
}
void function2 ()
{
key2=getch();
if(key2==KEY_LEFT)
printf("SUCCESS!!!");
}
this code makes it always say "item one" and doesn't work when it is in the second funcion. help would be appreciated