|
From: Ioannis V. <no...@ho...> - 2002-06-23 13:17:52
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Bob Wilson
> Sent: Sunday, June 23, 2002 4:04 PM
> To: Dev-C++ User Mailing List
> Subject: Re: [Dev-C++] New to C++
>
>
> Mike,
>
> > Just started with C++ in 24 hours
> > This book comes with a compiler. When i execute the first
> program as per
> the
> > book, a DOS screen flashes up very quickly and dissapears.
>
> Change the program from:
>
> #include <iostream>
>
> int main()
> {
> std::cout << "Hello World!\n";
> return 0;
> }
>
> to:
>
> #include <iostream.h>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> #include <stdlib.h>
>
> int main()
> {
> std::cout << "Hello World!\n";
> system("PAUSE");
> return 0;
> }
> Executing: C:\Program Files\ConTEXT\ConExec.exe "g++" "temp.cpp" -o
temp -ansi -pedantic-errors -Wall -fexpensive-optimizations -O3
-ffloat-store -mcpu=pentiumpro
In file included from c:/mingw/include/g++-v3/backward/iostream.h:31,
from temp.cpp:1:
c:/mingw/include/g++-v3/backward/backward_warning.h:32:2: warning:
#warning This file includes at least one deprecated or antiquated
header. Please consider using one of the 32 headers found in section
17.4.1.2 of the C++ standard. Examples include substituting the <X>
header for the <X.h> header for C++ includes, or <sstream> instead of
the deprecated header <strstream.h>. To disable this warning use
-Wno-deprecated.
> Execution finished.
>
> If you add the "#INCLUDE <stdlin.h>" and "system(*"PAUSE");"
> to each of the
> programs in the book, you will be able to see the programs'
> output. You can
> also open a DOS or command window and execute the program in
> that window.
> That is a bit of a pain in the ass, but it works very well.
>
> Regards,
>
> Bob
#include <iostream>
#include <cstdlib>
int main()
{
std::cout<<"Hello new world!\n";
std::system("pause");
}
Or he can avoid that and run his programs in the console directly.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|