isostream not working

when i put in this basic code into borland C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// operating with variables

#include <iostream>
using namespace std;

int main ()
{
  // declaring variables:
  int a, b;
  int result;

  // process:
  a = 5;
  b = 2;
  a = a + 1;
  result = a - b;

  // print out the result:
  cout << result;

  // terminate the program:
  return 0;
}

I get an error message saying:

1. unable to open file ISOSTREAM
2. declaring syntax error (doesnt recognize namespace std)
3. undefined symbol "cout" in function main()


do i have to download a file? what do i need to download and where do i put it? because i downloaded iostream.zip but not sure where to put the files or even if thats what i need
Last edited on
How exactly are you compiling this?
i'm not sure, i'm a newb. I installed borland c++ 4.5 then i open, copy and paste the code, and save as .cpp file. Am I missing a process?
http://tinyurl.com/ylzevgo

http://www.cprogramming.com/borland.html

http://elm.eeng.dcu.ie/~ee105/2005-2006/appendix/Appendix_BorlandC.pdf

It's probably best you don't copy paste code, you should type and compile so you get used to the syntax. What tutorial are you following? If your interested in programming, you should go to local library and borrow a newish book for beginners, or Go buy a new book.
Last edited on
Either your install is not correct or something is wrong about how you are using the compiler...

BCC 4.5 is "antique software", and pre-standard C++. I recommend you get rid of it and instead install the latest Turbo C++ Explorer http://www.turboexplorer.com/

To compile your code in BDS, start a new console application and cut and paste your code.
From the command prompt, simply cd to your program's directory and type

    bcc32 myprog.cpp

(where "myprog.cpp" is the name of your cpp file).

Hope this helps.
alright cool thanks! I did what both of u said and i also installed textpad. Only thing is, the older version had a text editor and I was also able to open the .exe files by just double clicking on them instead of having to always use command prompt. What would i need to download/install to be able to do that again?


edit: do i need visual c++ or c++ builder? or neither? lol
Last edited on
You can still just double-click the exe files... that's a Windows feature and has nothing to do with your development environment.

If your program runs quickly enough, though, you might not see the display... See this thread for more on how to fix it:
http://www.cplusplus.com/forum/articles/7312/

Good luck!
Topic archived. No new replies allowed.