simple program not working.

Hi,

I'm a newbie in c++ and i'm having trouble with running a simple program.
I'm using the TurboC++2.01 in compiling this program.

#include <stdlib.h>
#include <iostream.h>
using namespace std;

main()
{
cout << "Hello world";
cout << end;
}


it gives the following error when i compile this program:

Turbo C Version 2.01 Copyright (c) 1987, 1988 Borland International
mycodes\hello.c:
Error mycodes\hello.c 2: Unable to open include file 'iostream.h'
Error mycodes\hello.c 3: Declaration syntax error
Error mycodes\hello.c 8: Undefined symbol 'cout' in function main
Error mycodes\hello.c 8: Illegal use of pointer in function main
Error mycodes\hello.c 9: Undefined symbol 'end' in function main
Warning mycodes\hello.c 9: Code has no effect in function main
*** 5 errors in Compile ***


my guess is that i have the wrong compiler since it doesn't have the iostream.h.

i tried accessing from the forum a download of the compiler, unfortunately, the download links aren't active anymore.

http://www.cplusplus.com/forum/beginner/2628/

i'm requesting anyone to point me in the right direction.

thanks,
Marco

1. You're compiling C++ code with a C compiler. C++ compilers also come with C compilers, and they often determine which compiler to use based on the file extension. .c is the typical C source file extension (I think there are others, but I can't remember ATM). C++ source extensions include: .cpp, .C (note the upper case), .cxx, and .c++.
2. You're using a compiler that predates the current standard by 10 years. Actually, that compiler is as old as I am.
http://www.cplusplus.com/forum/articles/7263/
I recommend MS Visual C++.
Last edited on
Topic archived. No new replies allowed.