yet another beginner

ssiva

Registered
hello
I am also trying to learn c++ from the terminal. Have all the developers tools installed. I am using vi as my editor. Just typed in the program hello world from "Learning c++ in 21 days" verbatim. When I compile (using gcc <filename.c>) I get these errors:

1) First of it doesn't recognize the <iostream.h> inclusion - so I changed it <stdio.h> - on to the next error

2) it doesn't recognize cout

where is there a manual (preferably online) that can teach me c++ and show me the differences from this version of c++ and those found on most tutorials.

siva
 
You need to #include iostream (forum eats angle brackets) in order to use cout. What are you including now?
 
the forum ate my angel brackets alright!

i included iostream.h but it didn't recognize it
then i changed it to stdio.h at it seemed to recognize it fine but it still didn't recognize cout!?

what is the deal?

siva
:confused:
 
The problem is that you're using obsolete literature. The C++ standard streams are located within the std namespace, so either explicitely write std::cout instead of cout in your source code or put a line like this in front of your functions:
using namespace std;

Also,
#include &lt;iostream&gt;

not iostream.h! The .h files are still there for legacy compatibility but might become obsolete in the future.

Good luck! And enjoy!
 
Back
Top