|
From: Bob W. <bo...@ph...> - 2002-06-23 13:03:04
|
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;
}
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
|