Mail Archives: djgpp/1998/01/29/03:49:43
>maybe if you say also *which* error you got
>
> Sorry, I thought that I mentioned this in my original posting. The error
I got
> was that cout was used without being initialized first. But, according to
the
> documentation, libio.h does initialize cout, as well as cin and cerr. The
> listing again:
>
> #include <libio.h>
> void main()
> {
> cout << "Hello World!/n";
> }
sorry... I could not find it... maybe I didn't see that you had posted two
messages? Anyway:
use <iostream.h> in stead of <libio.h>. cin cout and cerr are declared
there.
BTW: remember to use "int main()" in stead of "void main()". This is the
ANSI
standard definition for main and in some systems other then DOS void main
causes
some problems.
One last thing (sorry :-) is: "/n" is not the newline char. It is "\n"
ciao
Giacomo
- Raw text -