Posted: Sat Jun 03, 2006 3:51 pm Post subject: getch: argument is wrong type
hey guys... i don't really get this .... when i used the getch command.. this is what happens... can anyone help me?
Sponsor Sponsor
wtd
Posted: Sat Jun 03, 2006 5:17 pm Post subject: (No subject)
What happens?
Null
Posted: Sat Jun 03, 2006 5:20 pm Post subject: (No subject)
This is the tutorials section. The correct forum is right above this one. Use your eyes.
I don't think getch is standard. Try using std::cin.get()
eg:
code:
#include <iostream>
int main() {
char ch;
std::cout << "Enter a character: ";
ch = std::cin.get();
std::cout << "You entered " << ch << std::endl;
}
[Gandalf]
Posted: Sat Jun 03, 2006 6:00 pm Post subject: (No subject)
If I recall correctly, getch() is a standard C method, which can probably be found in <cstdio>, or if you are using C, stdio.h.
Flikerator
Posted: Tue Jun 06, 2006 12:04 pm Post subject: (No subject)
[Gandalf] wrote:
If I recall correctly, getch() is a standard C method, which can probably be found in <cstdio>, or if you are using C, stdio.h.
Wouldn't it be C++ for stdio.h?
wtd
Posted: Tue Jun 06, 2006 12:16 pm Post subject: (No subject)
The stdio.h header is a C header file. C++ and C are different languages that just happen to be mostly compatible. The "cstdio" C++ header exists to wrap stdio.h up so you don't have to worry about the differences between C and C++ when you use it.