When I tried to compile this code, I get an error that variable "position" has not been defined for my int main. My defination for the variable is in my first function and I'm unsure of how to fix it. I've tried to put the variable defination in different places but putting it inside my int main just results in the function not working probably since it's not defined properly in that case. Any help to solve this is appreciated. Thanks.
Where do you place getPosition() in your main function ?
You just insert char position; in your main and have to put position = getPosition(x,y); somewhere. Maybe before printPosition(x,y,position);