下面的代码在DEVC++使用MinGW完美的作品,但Visual Studio 2008中吐出这样的:为什么getch()在Visual Studio 2008中不起作用?
error C3861: 'getch': identifier not found .
我能做些什么来接受的getch()如果这是不可能是那里参考getch(替代),我可以用来暂停屏幕?
代码:
#include <stdio.h>
#include <conio.h>
int main(void){
char str[] = "This is the end";
printf("%s\n", str);
getch(); //I tried getchar() also still does not work
return 0;
}
如何[GETC()(http://msdn.microsoft.com/en-us/library /5231d02a(v=vs.90).aspx)? – 2013-05-06 19:40:38
错误C2660:'getc':函数不接受0个参数 – Lyrk 2013-05-06 19:44:11
您必须将它传递给您想要读取的流,在本例中为'getc(stdin)'。 – 2013-05-06 19:45:45