|
From: Kenneth M. <k2...@ho...> - 2001-03-30 03:22:56
|
Am new to DevC++.
Whenever I try to run a simple program that I've got out of a book,
FAQ etc., which has been compiled successfully, it briefly flashes
up on the screen & disappears . ie. -
#include <iostream.h>
#include <stdlib.h>
int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!";
return 0;
system("PAUSE");
return 0;
}
or : -
#include <iostream.h>
int main()
{
cout << "Hello World!\n";
return (0);
}
Started doing some C++ a while ago and there was a Getche() command
to make the screen stay up - is there something similar ?
If someone can help me out with some sample programs, FAQ's etc., or
tell me where to get them would be greatly appreciated .
Thanks - KenM (k2...@ho...)
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
|
|
From: Andre` N. C. <ca...@op...> - 2001-03-30 03:39:10
|
You run the console app and windows closes it when you are done:) before your
return add
make sure you include <iostream.h>(I think thats the one.)
System("PAUSE");
Kenneth Macaulay wrote:
> Am new to DevC++.
> Whenever I try to run a simple program that I've got out of a book,
> FAQ etc., which has been compiled successfully, it briefly flashes
> up on the screen & disappears . ie. -
> #include <iostream.h>
> #include <stdlib.h>
>
> int main()
> {
> cout<<"HEY, you, I'm alive! Oh, and Hello World!";
> return 0;
>
> system("PAUSE");
> return 0;
> }
> or : -
> #include <iostream.h>
>
> int main()
> {
> cout << "Hello World!\n";
> return (0);
> }
> Started doing some C++ a while ago and there was a Getche() command
> to make the screen stay up - is there something similar ?
> If someone can help me out with some sample programs, FAQ's etc., or
> tell me where to get them would be greatly appreciated .
> Thanks - KenM (k2...@ho...)
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: <jos...@ya...> - 2001-03-30 06:54:56
|
Another option is
#include <stdio.h>
#include <iostream>
int main()
{
cout << "Hello World!\n";
getchar();
return 0;
}
Hope this helps
Chemanuel
--- Andre` Niel Cameron <ca...@op...> wrote:
> You run the console app and windows closes it when you are done:)
> before your
> return add
> make sure you include <iostream.h>(I think thats the one.)
> System("PAUSE");
>
> Kenneth Macaulay wrote:
>
> > Am new to DevC++.
> > Whenever I try to run a simple program that I've got out of a book,
> > FAQ etc., which has been compiled successfully, it briefly flashes
> > up on the screen & disappears . ie. -
> > #include <iostream.h>
> > #include <stdlib.h>
> >
> > int main()
> > {
> > cout<<"HEY, you, I'm alive! Oh, and Hello World!";
> > return 0;
> >
> > system("PAUSE");
> > return 0;
> > }
> > or : -
> > #include <iostream.h>
> >
> > int main()
> > {
> > cout << "Hello World!\n";
> > return (0);
> > }
> > Started doing some C++ a while ago and there was a Getche() command
> > to make the screen stay up - is there something similar ?
> > If someone can help me out with some sample programs, FAQ's etc.,
> or
> > tell me where to get them would be greatly appreciated .
> > Thanks - KenM (k2...@ho...)
> >
> >
>
_________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
|
|
From: Sam <sch...@ho...> - 2001-03-30 03:51:30
|
at end of program try typing system("PAUSE");
this will hold the screen untill the user hits any key....or you can use as
you mentioned in your email a getchar() or gets() statement.
S
----- Original Message -----
From: Kenneth Macaulay <k2...@ho...>
To: <dev...@li...>
Sent: Thursday, March 29, 2001 10:22 PM
Subject: [Dev-C++] RE:(DevC++)newbie
> Am new to DevC++.
> Whenever I try to run a simple program that I've got out of a book,
> FAQ etc., which has been compiled successfully, it briefly flashes
> up on the screen & disappears . ie. -
> #include <iostream.h>
> #include <stdlib.h>
>
> int main()
> {
> cout<<"HEY, you, I'm alive! Oh, and Hello World!";
> return 0;
>
> system("PAUSE");
> return 0;
> }
> or : -
> #include <iostream.h>
>
> int main()
> {
> cout << "Hello World!\n";
> return (0);
> }
> Started doing some C++ a while ago and there was a Getche() command
> to make the screen stay up - is there something similar ?
> If someone can help me out with some sample programs, FAQ's etc., or
> tell me where to get them would be greatly appreciated .
> Thanks - KenM (k2...@ho...)
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Vassili <v.v...@bt...> - 2001-03-31 02:40:50
|
You can also use
#include <conio.h>
_getch() ( i.e. underscore and getch() )
this function will not echo the character on the screen.
conio functions are useful for console programs, it is not classed as
standard on all compilers though.
----- Original Message -----
From: "Kenneth Macaulay" <k2...@ho...>
To: <dev...@li...>
Sent: Friday, March 30, 2001 4:22 AM
Subject: [Dev-C++] RE:(DevC++)newbie
> Am new to DevC++.
> Whenever I try to run a simple program that I've got out of a book,
> FAQ etc., which has been compiled successfully, it briefly flashes
> up on the screen & disappears . ie. -
> #include <iostream.h>
> #include <stdlib.h>
>
> int main()
> {
> cout<<"HEY, you, I'm alive! Oh, and Hello World!";
> return 0;
>
> system("PAUSE");
> return 0;
> }
> or : -
> #include <iostream.h>
>
> int main()
> {
> cout << "Hello World!\n";
> return (0);
> }
> Started doing some C++ a while ago and there was a Getche() command
> to make the screen stay up - is there something similar ?
> If someone can help me out with some sample programs, FAQ's etc., or
> tell me where to get them would be greatly appreciated .
> Thanks - KenM (k2...@ho...)
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|