iostream unable to open

1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
using namespace std;

int main ()
{
  int i;
  cout << "Please enter an integer value: ";
  cin >> i;
  cout << "The value you entered is " << i;
  cout << " and its double is " << i*2 << ".\n";
  return 0;
}


the iostream is unable to open what should i do??
Compiling NONAME01.CPP:
Error NONAME01.CPP 1: Unable to open include file 'IOSTREAM'
try:

 
#include <iostream.h> 


see if it's works... but, if it's works, that's mean you're using very old compiler...
it works but the another error is

using namespace std;

Compiling NONAME01.CPP:
Error NONAME01.CPP 2: Declaration syntax error
i'm using a Turbo c++ v.4.5 compiler
i have no idea why "namespace std" is not recognized, but it's better if you use visual studio 2010 / 2008. TC++ is very old (and deprecated? (my opinion))
Last edited on
I'm guessing it's not recognized because the STL wasn't a part of c++ until around 1994. Can you use a newer compiler?
but our prof. told us the will only use the turbo c++... T_T
I just went off of some research I quickly did via Google. I could be wrong. I've never had to output to console without STL. Someone else?
1
2
3
4
5
6
7
8
9
10
11
#include <iostream.h>

int main ()
{
  int i;
  cout << "Please enter an integer value: ";
  cin >> i;
  cout << "The value you entered is " << i;
  cout << " and its double is " << i*2 << ".\n";
  return 0;
}



You should tell your professor that he is a idiot if forces you to use such compilers.
XD
In India, all computer science books for class 11 and 12 tell us to use Borland Turbo C++. The code we write in our exams should be completely compatible with TC++. All teachers are trained on TC++. All inter-school competitions use TC++. I talked about this with my computer teacher and she said that even she prefers to use new compilers but the education system is corrupt here. Books here still tell us that sizeof(int) is 2, which means that the syllabus hasn't been upgraded since 16-bit computers existed.

Luckily, the web has a lot to offer and I am up to date. Also my school uses VC++ 6.0, which is compatible with both C++ dialects.

If you are really interested in C++, get a good compiler and learn from a good tutorial. But you also have to be good at TC++ because it is used in your institute.

Some functions exist in TC++ but not in standard C++, like gotoxy(int,int) and clrscr(). You may find good alternatives to these functions in the Articles section of this website.
Last edited on
tnx for d help.. :D
Topic archived. No new replies allowed.