Thread: [Dev-C++] How do I pause a program?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Giligun <too...@ya...> - 2003-03-04 17:32:20
|
I want it to display some information until a button is pressed. The Bloddshed software I have has the .h file with some command to do, but I wanna know how it works without this. __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |
|
From: Tina B. <t_b...@co...> - 2003-03-04 17:55:31
|
This is one way, although there are probably others. Without this, my =
dos window closes before I can see it...
=20
// Tina Barnes
//
#include <iostream> // For cout and cin
#include <cstdlib> // For system("PAUSE")
using namespace std; =20
int main()
{
// your program goes here...
system("PAUSE");
return 0;
}
----- Original Message -----=20
From: Giligun=20
To: dev...@li...=20
Sent: Tuesday, March 04, 2003 9:32 AM
Subject: [Dev-C++] How do I pause a program?
I want it to display some information until a button
is pressed. The Bloddshed software I have has the .h
file with some command to do, but I wanna know how it
works without this.
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The =
debugger=20
for complex code. Debugging C/C++ programs can leave you feeling lost =
and=20
disoriented. TotalView can help you find your way. Available on major =
UNIX=20
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Louis G. <lg...@ya...> - 2003-03-04 19:19:40
|
There is another way... try getch() instead of system()
--- Tina Barnes <t_b...@co...> wrote:
> This is one way, although there are probably others. Without this, my
> dos window closes before I can see it...
>
>
> // Tina Barnes
> //
>
> #include <iostream> // For cout and cin
> #include <cstdlib> // For system("PAUSE")
> using namespace std;
>
> int main()
> {
> // your program goes here...
> system("PAUSE");
> return 0;
> }
>
> ----- Original Message -----
> From: Giligun
> To: dev...@li...
> Sent: Tuesday, March 04, 2003 9:32 AM
> Subject: [Dev-C++] How do I pause a program?
>
>
> I want it to display some information until a button
> is pressed. The Bloddshed software I have has the .h
> file with some command to do, but I wanna know how it
> works without this.
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The
> debugger
> for complex code. Debugging C/C++ programs can leave you feeling lost
> and
> disoriented. TotalView can help you find your way. Available on major
> UNIX
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
|
|
From: Tina B. <t_b...@co...> - 2003-03-04 18:32:01
|
Here's another way to pause a program...
// how to pause program
// uses ENTER key to continue
#include <iostream> // For cout and cin
#include <cstdio> // For getchar ()
using namespace std;
int main()
{
cout << "Some sort of output to screen!" << endl;
cout << "Press ENTER to continue..." << endl;
getchar ();
cout << "Print something else..." << endl;
cout << "Press ENTER to continue..." << endl;
getchar ();
return 0;
}
----- Original Message -----=20
From: Giligun=20
To: dev...@li...=20
Sent: Tuesday, March 04, 2003 9:32 AM
Subject: [Dev-C++] How do I pause a program?
I want it to display some information until a button
is pressed. The Bloddshed software I have has the .h
file with some command to do, but I wanna know how it
works without this.
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The =
debugger=20
for complex code. Debugging C/C++ programs can leave you feeling lost =
and=20
disoriented. TotalView can help you find your way. Available on major =
UNIX=20
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Ioannis V. <no...@ho...> - 2003-03-04 19:15:48
|
-------Original Message-------=0D
=0D
From: Tina Barnes=0D
Date: =D4=F1=DF=F4=E7, 4 =CC=DC=F1=F4=E9=EF=F2 2003 8:34:56 =EC=EC=0D
To: dev...@li...=0D
Subject: Re: [Dev-C++] How do I pause a program?=0D
=0D
Here's another way to pause a program...=0D
=0D
// how to pause program=0D
// uses ENTER key to continue=0D
=0D
#include <iostream> // For cout and cin=0D
#include <cstdio> // For getchar ()=0D
=0D
=0D
=3D=3D> The above can be avoided.=0D
=0D
=0D
using namespace std;=0D
=0D
=3D=3D> Better in local scope.=0D
=0D
=0D
int main()=0D
{=0D
cout << "Some sort of output to screen!" << endl;=0D
cout << "Press ENTER to continue..." << endl;=0D
getchar ();=0D
=0D
cout << "Print something else..." << endl;=0D
cout << "Press ENTER to continue..." << endl;=0D
getchar ();=0D
=0D
=3D=3D> Better cin.ignore();=0D
=0D
=0D
return 0;=0D
}=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20
|
|
From: Tina B. <t_b...@co...> - 2003-03-04 19:32:15
|
Thanks, it works
// how to pause system #3
//
#include <iostream> // For cout and cin
using namespace std;
int main()
{
cout << "Press ENTER to continue..." << endl;
cin.ignore();
return 0;
}
----- Original Message -----=20
From: Ioannis Vranos=20
To: dev...@li...=20
Sent: Tuesday, March 04, 2003 11:15 AM
Subject: Re: [Dev-C++] How do I pause a program?
-------Original Message-------
=20
From: Tina Barnes
Date: =D4=F1=DF=F4=E7, 4 =CC=DC=F1=F4=E9=EF=F2 2003 8:34:56 =EC=EC
To: dev...@li...
Subject: Re: [Dev-C++] How do I pause a program?
=20
Here's another way to pause a program...
=20
// how to pause program
// uses ENTER key to continue
=20
#include <iostream> // For cout and cin
#include <cstdio> // For getchar ()
=20
=20
=3D=3D> The above can be avoided.
=20
=20
using namespace std;
=20
=3D=3D> Better in local scope.
=20
=20
int main()
{
cout << "Some sort of output to screen!" << endl;
cout << "Press ENTER to continue..." << endl;
getchar ();
=20
cout << "Print something else..." << endl;
cout << "Press ENTER to continue..." << endl;
getchar ();
=20
=3D=3D> Better cin.ignore();
=20
=20
return 0;
}
=20
=20
=20
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys=20
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The =
debugger=20
for complex code. Debugging C/C++ programs can leave you feeling lost =
and=20
disoriented. TotalView can help you find your way. Available on major =
UNIX=20
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Ioannis V. <no...@ho...> - 2003-03-04 19:44:11
|
=0D
#include <iostream> =0D
=0D
=0D
int main()=0D
{=0D
=3D=3D> using namespace std;=0D
=0D
cout << "Press ENTER to continue..." << endl;=0D
=0D
cin.ignore();=0D
=0D
return 0;=0D
}=0D
=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys =0D
=0D
=0D
=0D
-------Original Message-------=0D
=0D
From: Tina Barnes=0D
Date: =D4=F1=DF=F4=E7, 4 =CC=DC=F1=F4=E9=EF=F2 2003 9:37:04 =EC=EC=0D
To: dev...@li...=0D
Subject: Re: [Dev-C++] How do I pause a program?=0D
=0D
Thanks, it works=0D
=0D
// how to pause system #3=0D
//=0D
=0D
#include <iostream> // For cout and cin=0D
using namespace std;=0D
=0D
int main()=0D
{=0D
cout << "Press ENTER to continue..." << endl;=0D
cin.ignore();=0D
=0D
return 0;=0D
}
|