Thread: [Dev-C++] How to not close output win?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Massimo B. <kb...@ce...> - 2003-10-03 09:56:53
|
Hi,
I am using Dev-C++ to teach C++ at my university. The first examples I
discuss in class are very very simple (like hello word). Anyway I would
like to show the output. Unfortunately, Dev-C++ close immediately the
output window. I did not find any options to change this behaviour.
Is there any solution (apart to use kludges like system("pause"); at the
end of my code)?
Thanks,
Massimo
--
Massimo Bertozzi
Dipartimento di Ingegneria dell'Informazione Voice: +39 0521 90 5735
Parco Area delle Scienze, 181A, Parma, ITALY Fax: +39 0521 90 5723
WWW: http://www.ce.unipr.it/people/bertozzi E-mail: ber...@CE...
|
|
From: Tim S. <ti...@we...> - 2003-10-03 10:15:03
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Massimo and hi list,
Massimo Bertozzi wrote:
| Is there any solution (apart to use kludges like
system("pause"); at the
| end of my code)?
I have found the following, works fine for me, but don't ask me
what it realy means ;)
void wait ()
{
~ cin.clear ();
~ cin.ignore ( cin.rdbuf () -> in_avail () );
~ cin.get ();
}
so long
Tim
- --
WE ARE TEH BORG!
~ RESSISTANCE IS FUTILE!
~ http://we-are-teh-b.org/~tim/borg.key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (MingW32)
iD8DBQE/fUxXsMXChvH2qP0RAvoLAJ9oS4A+mR1N0NE0cc9wmDN5Uorq+wCfS18G
hfgV7I5f9mTYnMn2NW++17A=
=WQIR
-----END PGP SIGNATURE-----
|
|
From: Massimo B. <kb...@ce...> - 2003-10-03 10:32:23
|
On Fri, Oct 03, 2003 at 12:15:54PM +0200, Tim Schumacher <ti...@we...> wrote:
>
> void wait ()
> {
> ~ cin.clear ();
> ~ cin.ignore ( cin.rdbuf () -> in_avail () );
> ~ cin.get ();
> }
More elegant than mine, but still not very confortable. I had to put a
wait() at every exit point.
M.
--
Massimo Bertozzi
Dipartimento di Ingegneria dell'Informazione Voice: +39 0521 90 5735
Parco Area delle Scienze, 181A, Parma, ITALY Fax: +39 0521 90 5723
WWW: http://www.ce.unipr.it/people/bertozzi E-mail: ber...@CE...
|
|
From: Neszt T. <ne...@ss...> - 2003-10-03 10:21:58
|
> I am using Dev-C++ to teach C++ at my university. The first examples I > discuss in class are very very simple (like hello word). Anyway I would > like to show the output. Unfortunately, Dev-C++ close immediately the > output window. I did not find any options to change this behaviour. :-))))))) I recommend the dev-c++ develoopers to make a new example witch show this to avoid these questions in the future.. Neszt Tibor |
|
From: Natalie B. <nap...@lo...> - 2003-10-03 10:39:48
|
Hi Neszt,
Reid sent me this solution yesterday to the same problem. It instantly =
made everything work properly... Shown below.
Kind rgeards
Natalie
-------------------------------------------------------------------
add the following line just before the return in your main function
system("PAUSE");=20
If you create a new project in Dev-cpp it gens an intial main function =
with this in it by default:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
=20
system("PAUSE");=20
return 0;
}
This should remedy the closing of the window.
reid=20
----- Original Message -----=20
From: Neszt Tibor=20
To: Massimo Bertozzi=20
Cc: Dev...@li...=20
Sent: Friday, October 03, 2003 11:18 AM
Subject: Re: [Dev-C++] How to not close output win?
> I am using Dev-C++ to teach C++ at my university. The first =
examples I
> discuss in class are very very simple (like hello word). Anyway I =
would
> like to show the output. Unfortunately, Dev-C++ close immediately =
the
> output window. I did not find any options to change this behaviour.
:-)))))))
I recommend the dev-c++ develoopers to make a new example witch show =
this
to avoid these questions in the future..=20
Neszt Tibor
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
=20
|
|
From: Massimo B. <kb...@ce...> - 2003-10-03 10:55:40
|
On Fri, Oct 03, 2003 at 11:39:33AM +0100, Natalie Bryant <nap...@lo...> wrote:
> Hi Neszt,
>
> Reid sent me this solution yesterday to the same problem. It instantly made everything work properly... Shown below.
Yes, until you have a single exit in your program. When you have more
possibilities you have to replicate the system("pause") everywhere.
M.
--
Massimo Bertozzi
Dipartimento di Ingegneria dell'Informazione Voice: +39 0521 90 5735
Parco Area delle Scienze, 181A, Parma, ITALY Fax: +39 0521 90 5723
WWW: http://www.ce.unipr.it/people/bertozzi E-mail: ber...@CE...
|
|
From: Natalie B. <nap...@lo...> - 2003-10-03 11:04:04
|
Thankyou Massimo,
I'll bear that in mind for later when I need it.
Kind regards
Natalie
----- Original Message -----=20
From: Massimo Bertozzi=20
To: Natalie Bryant=20
Cc: devc++=20
Sent: Friday, October 03, 2003 11:55 AM
Subject: Re: [Dev-C++] How to not close output win?
On Fri, Oct 03, 2003 at 11:39:33AM +0100, Natalie Bryant =
<nap...@lo...> wrote:
> Hi Neszt,
>=20
> Reid sent me this solution yesterday to the same problem. It =
instantly made everything work properly... Shown below.
Yes, until you have a single exit in your program. When you have =
more
possibilities you have to replicate the system("pause") everywhere.
M.
--=20
Massimo Bertozzi =20
Dipartimento di Ingegneria dell'Informazione Voice: +39 0521 90 =
5735
Parco Area delle Scienze, 181A, Parma, ITALY Fax: +39 0521 90 =
5723
WWW: http://www.ce.unipr.it/people/bertozzi E-mail: =
ber...@CE...
=20
|