下面的代碼在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