Has anyone ever had a problem using getch() with dev c++ compiler?
If so how do i fix it?
or is this function only standard with Borland?
Cheers guys
Boontune
Printable View
Has anyone ever had a problem using getch() with dev c++ compiler?
If so how do i fix it?
or is this function only standard with Borland?
Cheers guys
Boontune
getch() is a non-standard function and its generally present in the headerfile <conio.h> // console input output headerfileQuote:
Originally posted by boontune
Has anyone ever had a problem using getch() with dev c++ compiler?
If so how do i fix it?
or is this function only standard with Borland?
Cheers guys
Boontune
why don't you create a dummy variable and use a cin
Code:char dummy;
cin >> dummy; // ofcourse it will wait till you press enter key
cin.ignore(); // to flush the '\n' (enterkey) if still in the stream
Why no use cin.get() (no params) to wait for the enter key?
-Futura
What is the problem you are having?! I didn't have one but I hope I can help you.Quote:
Originally posted by boontune
Has anyone ever had a problem using getch() with dev c++ compiler?
If so how do i fix it?
or is this function only standard with Borland?
Cheers guys
Boontune
Code:cout << "Press any key to continue....";
char wait = getch();
// or
cout << "Press any key to continue....";
cin.get();
It looks as if getch() isn't in conio.h, but I got this to work with a bit of effort
Dev C++ ver 4.?
Look in the conio.c and conio.h files for seeing what code is finished. It looks like some of the functs aren't et done.Code:#include <iostream>
#include "C:\Dev-C++\Include\conio.h"
using namespace std;
int main(void)
{
char letter;
letter = getche();
return 0;
}
Try including conio_mingw.h instead of conio.h
-Futura
Thanks alot for your help guys!
Il give it ago and let you know how i got on.
Cheers
Boontune