Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dev-C++ y wont 'getch()' work in console apps?

Status
Not open for further replies.

DollyDagger

Technical User
Nov 28, 2000
30
GB
Hihi! So when i use Cbuilder or TurboC++ at work getch()(sorry im a newbie to C++) works fine, but when i use Dev at home, getch() and conio.h cause compilation errors, and it sez something about getchar()? Isnt this something else?Pls help because it generally helps if you can see the output of progs ;)
 
Which OS are you using at work and at home? What version of DEV, CBC, and Turbo C++ are you using? What is the exact error message the compiler giving you?
James P. Cottingham
 
You have to include a file called conio.c.

On a compiler such as Turbo or Borland, you include conio.h, but for some reason, conio.h does not work with Dev.

So just do:
#include <iostream.h>
#include <conio.c>

And you should be able to use all of conio.h's functions, such as getch() and textcolor().

Hope this helps,

-Vic vic cherubini
malice365@hotmail.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 

I don't know anything about c++.
I just downloaded dev-c++. But I can't compile a simple hello-world program.
Code:
//include this file for cout
#include <iostream.h>

int main() {

  //print out the text string, &quot;Hello, World!&quot;
  cout << &quot;Hello, World!&quot; << endl;

  return 0;

}
Can somebody help me?
Thanks
 
I have tried working with DevC++ also. Are you using the Beta release? It has a lot of bugs. They have a forum for all Bloodshed software at sourceforge This may be able to help you if you can get an answer from someone. They seem to be very clique oriented and only talk to each other. newcomers are ignored. If you want to do any useful programming at home I don't recommend DevC++ at the moment. You are better off to pick up a second hand C Builder somewhere.
Regards from Bluewater on the Great Barrier Reef.
 
You can also download Version 5.5 of Borland's compiler and debugger for free at Borland's site. This is the same compiler that Builder 5 uses but without the rapid application tools.

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top