From: Vassili <v.v...@bt...> - 2001-08-13 18:39:28
|
You can execute you program via DOS prompt or by inserting something like system("PAUSE") or getchar() before the return. Anyway, straying from the point. DOS actually helps out on performing some things, if I remember right, the getchar() function would cause a program to echo what is written. When a letter is typed, dos would print (echo) it and when return is pressed, the program executes, printing the stored data. This is why conio.h was created, I suppose, to bypass this help, getch() executes once the key is pressed. I'm not to sure how accurate my memory is, I read this a while back. ----- Original Message ----- From: "Clayton Weaver" <vgd...@ho...> To: <dev...@li...> Sent: Monday, August 13, 2001 3:04 PM Subject: [Dev-C++] (no subject) > I made a simple program to test the compiling and run options in the Dev-C++ > program. The program I wrote was just a simple one that told the computer to > output the string "hello world" to the screen when you ran the program. That > is where the problem is though. I have Windows 98 and I have the DJGPP > compiler with Rhide interface and the MinGW compiler and I just recently > downloaded the Dev-C++ software and I like it, but I'm having trouble with > it. Let me start from the beginning. The simple program I wrote had this as > the source code: > > #include <iostream.h> > > int main() > { > cout<<"hello world"; > return0; > } > > I compiled the program without any problems, but when I run it or try to > click on the .exe file in the c:\ drive it pops up the program real quick > and closes it back out instead of keeping it up until I click the exit > button at the top of the window. Why does it do this and how can I make it > stop? My DJGPP with Rhide interface lets the identical program I wrote in it > stay open until I click the x on the screen to close it, but Dev-C++ opens > the program and closes it write back(the program was written in Dev-C++). > Thanks for any and all help that you can offer me:). > > --Clayton Weaver > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |