There are many problems with your code.
while (true==true)
This is not necessary. A simple
while(true)
would suffice.
if (KeyStroke = 0)
This is incorrect. You use = instead of ==, so KeyStroke is assigned value 0 instead of being tested against 0. It should be
if (KeyStroke == 0)
.
switch (character)
{
case 'up':
up
is a string, not a character, so it should be enclosed in double quotes, i.e.
"up"
. However, in C++ you cannot switch on strings. If you want to compare against strings then you have to use if-else statements. Like this:
if(character == "up") {}
else if(character == "down") {}
However, you can simplify this a lot using just characters such as u,d,r,l (as already suggested). However, I think a better option would be to check directly the keystroke and don't convert it to a string or another char again.