using iostream in gcc

A

Anirudh Ramesh

I need to use gcc for a competition. I'm pretty fluent in turbo c++.
I'm using rhide as the ide for gcc. When I use iostream.h, i get an
"antequated or deprecated header file. consider using one of the 32
header files found in section 17.4.1.2of the C++ standard." When I
just use iostream, i get a messasge similar to "the functions cin and
cout are undefined." I need help quickly.
 
S

Sharad Kala

Anirudh Ramesh said:
I need to use gcc for a competition. I'm pretty fluent in turbo c++.
I'm using rhide as the ide for gcc. When I use iostream.h, i get an
"antequated or deprecated header file. consider using one of the 32
header files found in section 17.4.1.2of the C++ standard." When I
just use iostream, i get a messasge similar to "the functions cin and
cout are undefined." I need help quickly.

Everything in standard headers like <iostream> is inside std namespace, hence
it's std::cin and std::cout .
btw, cin and cout are not functions.
 
M

Michael Schutte

Anirudh said:
I need to use gcc for a competition. I'm pretty fluent in turbo c++.
I'm using rhide as the ide for gcc. When I use iostream.h, i get an
"antequated or deprecated header file. consider using one of the 32
header files found in section 17.4.1.2of the C++ standard." When I
just use iostream, i get a messasge similar to "the functions cin and
cout are undefined." I need help quickly.

Here it is! The new headers define cin and cout in a *namespace* std. If
you want to use them, write
std::cout << 5;
or similar; or, if you want to use std:: everytime without having to
write it,
using namespace std;
at global scope.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top