|
From: Daniel G. <sp...@ho...> - 2001-11-29 15:56:51
|
<html><div style='background-color:'><DIV>
<P>Dev will pop up then down quickly in short programs because the program has executed, finished, and thus destroyed the window.</P>
<P>What I normally do is add something like cin>>x; that way the computer MUST wait for me to push a button to resume and thus exit the program.</P>
<P>oh and it should be #include <iostream.h></P>
<P> </P>
<P>Hope that helps!<BR><BR></P></DIV>
<DIV></DIV>
<DIV></DIV>>From: "Jeff Clark" <JA...@SP...>
<DIV></DIV>>To: "Dev-C++ mailing list" <DEV...@LI...>
<DIV></DIV>>Subject: [Dev-C++] Run Problem
<DIV></DIV>>Date: Thu, 29 Nov 2001 07:42:37 -0800
<DIV></DIV>>
<DIV></DIV>>Hello,
<DIV></DIV>>
<DIV></DIV>>I'm new to C++ development; in fact I'm trying to learn by "Sams Teach
<DIV></DIV>>Yourself C++".
<DIV></DIV>>
<DIV></DIV>>I have installed Dev-C++, and have written a test program, the program
<DIV></DIV>>compiles, but when running it, it only flashes quickly on the screen.
<DIV></DIV>>
<DIV></DIV>>My system is a Pentium III with Windows 2000 installed, the program is
<DIV></DIV>>stated below, as it is in the book:
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> #include <IOSTREAM.H>
<DIV></DIV>>
<DIV></DIV>>int main()
<DIV></DIV>>{
<DIV></DIV>>int x = 5;
<DIV></DIV>>int y = 7;
<DIV></DIV>>cout << "\n";
<DIV></DIV>>cout << x + y << " " << x * y;
<DIV></DIV>>cout << "\n";
<DIV></DIV>>return 0;
<DIV></DIV>>}
<DIV></DIV>>
<DIV></DIV>> ????? What am I doing wrong that the program when executed does not stay up
<DIV></DIV>>on the screen????
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Sincerely,
<DIV></DIV>>
<DIV></DIV>>Jeff
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>_______________________________________________
<DIV></DIV>>Dev-cpp-users mailing list
<DIV></DIV>>Dev...@li...
<DIV></DIV>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
|
|
From: Mike M. <mc...@ms...> - 2001-11-29 17:23:06
|
Hello Jeff,
You'll have to put a catch in there to stop the window from closing. What's
happening is the program is opening the dos window, executing, then closing
the dos window when its done. You see a flashing window :)
Include the header file stdlib.h (#include <stdlib.h>) then add, at the
bottom of your program before the return statement the command
"system("pause");" This will hold the window open for you long enough to
see the stuff (till you hit a key)
Mike
>My system is a Pentium III with Windows 2000 installed, the program is
>stated below, as it is in the book:
>
>
>
> #include <iostream.h>
>
>int main()
>{
>int x = 5;
>int y = 7;
>cout << "\n";
>cout << x + y << " " << x * y;
>cout << "\n";
>return 0;
>}
>
> ????? What am I doing wrong that the program when executed does not stay
>up
>on the screen????
>
>
>Sincerely,
>
>Jeff
>
>
>
>
>
>
>
>
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|
|
From: Julio L. <ju2...@ya...> - 2001-12-02 05:16:38
|
I don't know what kind of problems you guys are having
with system("PAUSE"); but I just had a problem with it
today for the first time, and I have used
system("PAUSE"); many times before without a problem.
It was weird because even when I put a
system("PAUSE"); it would not output "Please press any
key to continue..." and it would only slow down for
like 4 seconds and continue the program as if I had
never put in a system("PAUSE"); . I realized that this
only happens if you execute your program by pressing
the Execute button in Dev-C++, but not when you
manually find the folder it is in and execute it by
double clicking it... might be a problem with Dev-C++
but not sure.
=====
Julio
__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com
|
|
From: Ioannis V. <no...@ya...> - 2001-12-02 07:48:03
|
You probably forgot to #include <stdlib.h>. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Julio Lajara > Sent: Sunday, December 02, 2001 7:17 AM > To: dev...@li... > Subject: [Dev-C++] RE: Run Problem > > > I don't know what kind of problems you guys are having > with system("PAUSE"); but I just had a problem with it > today for the first time, and I have used > system("PAUSE"); many times before without a problem. > It was weird because even when I put a > system("PAUSE"); it would not output "Please press any > key to continue..." and it would only slow down for > like 4 seconds and continue the program as if I had > never put in a system("PAUSE"); . I realized that this > only happens if you execute your program by pressing > the Execute button in Dev-C++, but not when you > manually find the folder it is in and execute it by > double clicking it... might be a problem with Dev-C++ > but not sure. > > ===== > Julio > > __________________________________________________ > Do You Yahoo!? > Buy the perfect holiday gifts at Yahoo! Shopping. > http://shopping.yahoo.com > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Julio L. <ju2...@ya...> - 2001-12-02 23:25:14
|
I did include stdlib.h. I recompiled and everything, but it still had that weird problem... -----ORIGINAL MESSAGE----------------------- Message: 6 From: "Ioannis Vranos" <no...@ya...> To: "Dev-C++" <dev...@li...> Subject: RE: [Dev-C++] RE: Run Problem Date: Sun, 2 Dec 2001 09:48:36 +0200 You probably forgot to #include <stdlib.h>. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Julio Lajara > Sent: Sunday, December 02, 2001 7:17 AM > To: dev...@li... > Subject: [Dev-C++] RE: Run Problem > > > I don't know what kind of problems you guys are having > with system("PAUSE"); but I just had a problem with it > today for the first time, and I have used > system("PAUSE"); many times before without a problem. > It was weird because even when I put a > system("PAUSE"); it would not output "Please press any > key to continue..." and it would only slow down for > like 4 seconds and continue the program as if I had > never put in a system("PAUSE"); . I realized that this > only happens if you execute your program by pressing > the Execute button in Dev-C++, but not when you > manually find the folder it is in and execute it by > double clicking it... might be a problem with Dev-C++ > but not sure. > > ===== > Julio > > __________________________________________________ > Do You Yahoo!? > Buy the perfect holiday gifts at Yahoo! Shopping. > http://shopping.yahoo.com ===== Julio __________________________________________________ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com |
|
From: graeme <gr...@dr...> - 2001-12-04 02:50:18
|
When you created the project did you select console? If you select a windows project then you will get the effect that you had described. Graeme. Julio Lajara wrote... > I did include stdlib.h. I recompiled and everything, > but it still had that weird problem... |