>I'm just wondering if this is ever going to be a legal statement.
It never has been and never will be. Try this instead:
Code:
do {
key=getch();
} while ( key != '1' && key != '2' && key != '3' );
Or better yet, write a function to validate key and use the return value in your loop condition for readability and maintenance purposes:
Code:
do {
key=getch();
} while ( !keyCheck ( key ) );
>Would it be possible to return both xval and yval at the end of the function
Yes, but it would take a bit of fiddling. A better way would be to store both xval and yval in a struct and then return that struct so that both values can be easily returned AND they remain bound to each other as it should be:
Code:
struct SCREEN_COORD
{
int xval,
yval;
} coord;
-Prelude