while (gameon = true) {
char ch = _getch();
if (ch == 'd') {
move = move + 1;
ch = "";
}
}
I get this error and kind find anything to fix this on this forum
while (gameon = true) {
char ch = _getch();
if (ch == 'd') {
move = move + 1;
ch = "";
}
}
I get this error and kind find anything to fix this on this forum
With ch = "", you are attempting to assign a string to a char type. This is what the compiler is complaining about.
Since you are setting ch in each iteration of the loop, it is not necessary to try to clear the variable.
Also, you need to fix your while loop: replace = true with == true)