Please help, im trying to get the answer and when the answer is true, it will print, otherwise false, i dont know what im going to do, i cant ge the right if statement.. thanks in advance
First, I imagine you're trying to get a string. You're testing to see if the user entered "row" not 'r', 'o', 'w'. Because of this, your scanf statements needs to take a string, not a char. Also, your row variable needs to hold a string, not an array of characters. Secondly, if you're using scanf, you're not allowed to store input in the string class. You have to use a char array. Some amended code:
1 2 3 4
char ans[4]; //you hold your scanf input in a char array instead of a string
string row = "row"; //holds a string, rather than an array of chars like { 'r', 'o', 'w' }
....
scanf("%s", &ans); // %s instead of %c so that you can store a string rather than a char
I'd suggest studying up on char arrays vs strings. Char arrays are typically kept to the C language and scanf. Strings are for the C++ language and are used with cin.
@Keene thank you very much! I've been stuck in this code for days, thanks a lot for the help. and will do look for strings and array. though im still studying the c language right now.