我是C++的初学者.__CODE__当我尝试调试Microsoft Visual C++ 2010 Express中的任何项目时,我收到错误.我在Stackoverflow和Google上搜索了我应该做的事情,但找不到答案.我所理解的文件msvcrtd.lib应该在map\Microsoft Visual Studio 10.0\VC\lib中,但该文件不存在.我该怎么办?
我希望输出说出用户按下的箭头键.我得到的输出是:
"You pressed the Dz? button."
Run Code Online (Sandbox Code Playgroud)
我写的是:
unsigned int key;
string K;
do
{
key = getch();
if (key==72)
K=" up";
else if(key==80)
K="down";
else if (key==77)
K="right";
else if (key==75)
K="left";
else
{}
if (key!=224)
printf("You pressed the %s button.\n", K);
else
{}
}while(key !='q');
return;
Run Code Online (Sandbox Code Playgroud) 我没有在我的代码中使用递归,所以我不明白为什么我收到关于递归的错误................................................... .........................................
代码是:
from os import system
from time import sleep
import msvcrt
player_location = [0, 0]
player_dir = [0, 0]
width = int(raw_input('Width:'))
height = int(raw_input('Height:'))
def get_input():
if msvcrt.kbhit():
return msvcrt.getch()
else:
return ''
def update_screen():
global player_location
system('cls')
for i in range(0, (height-1)):
if i == player_location[0]:
print (' ' * (player_location[1] - 1)) + 'X' + (' '*(width*2 - player_location[1] - 1)) + '|'
else:
print (' ' * width * 2) + '|'
print ('-' …Run Code Online (Sandbox Code Playgroud)