problem with bloodshed
I have just started to learn c++ and I am using the bloodshed compiler to make dos programs, and whenever I run my tiny little "Hello World" program it gives me about 1/2 a second to see what ive done (or screwed up) before minimizing again. Is there any way to keep the dos window up longer so I can actually see my program without getting an epileptic fit?? please help the newbie!
Try to execute the program from a manually created dos window. That usually does the trick. The same thing happens if you ping from the run window off the start button. I believe there is also a setting that you can apply to your standard dos window so that when it is called it stays open even after the application is finished. I am not sure what it is or how to set it though I do think it exists.
Kressilac
Kressilac
Derek Licciardi (Kressilac)Elysian Productions Inc.
quote: Original post by berp
I have just started to learn c++ and I am using the bloodshed compiler to make dos programs, and whenever I run my tiny little "Hello World" program it gives me about 1/2 a second to see what ive done (or screwed up) before minimizing again. Is there any way to keep the dos window up longer so I can actually see my program without getting an epileptic fit?? please help the newbie!
hi,
try this.
#include
#include // getch();
void main(void)
{
std::cerr << "Hello world" << std::endl;
getch();
}
Depending on the compiler you use, you will also find
function like hitkb() for hit keyboard.
cu
Peter
HPH
July 27, 2000 09:03 AM
quote: Original post by phemmerOriginal post by berp
I have just started to learn c++ and I am using the bloodshed compiler to make dos programs, and whenever I run my tiny little "Hello World" program it gives me about 1/2 a second to see what ive done (or screwed up) before minimizing again. Is there any way to keep the dos window up longer so I can actually see my program without getting an epileptic fit?? please help the newbie!
hi,
Oops, the Html has swallowed my include brackets so:
try this.
1. include is iostream
2. include is conio.h
cu
Peter
Can''t you just add a scanf before the return 0 line? That would wait for the Enter key to be pressed before exiting the program.
BeS
It's Da BOMB Baby!!!
BeS
It's Da BOMB Baby!!!
BeSIt's Da BOMB Baby!!!. o O ~ A little nonsense now and then,is relished by the wisest men~ O o .-- Willy Wonka
system("PAUSE");
conio.h is not portable and not ansi standard
-----------------------------
A wise man once said "A person with half a clue is more dangerous than a person with or without one."
conio.h is not portable and not ansi standard
-----------------------------
A wise man once said "A person with half a clue is more dangerous than a person with or without one."
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt
August 04, 2000 01:14 AM
I also use the Bloodshed compiler, and the best and most effictient way to handle this situation is to include conio.h, and at the end of your program, before you return 0, use the getch() function.
example:
-----------------------------------------------------------------
#include
#include
int main()
{
cout<<"Hello world!";
getch();
return 0;
}
-----------------------------------------------------------------
example:
-----------------------------------------------------------------
#include
#include
int main()
{
cout<<"Hello world!";
getch();
return 0;
}
-----------------------------------------------------------------
August 04, 2000 01:16 AM
Note: the 2 includes up there were cut off.
they were:
1) iostream.h
2) conio.h
they were:
1) iostream.h
2) conio.h
Try right-clicking on your exe and from the menu go to properties, then the program tab, and near the bottom should be a Close on Exit [x] box like that, just make sure that it isn''t checked and your app wont automatically close the window when it finishes.
------------
- outRider -
------------
- outRider -
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement