×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Borland C++ 5.02

Borland C++ 5.02

Borland C++ 5.02

(OP)
Hi Guys! When run the code below in my Borland C++ 5.02 i get the error msg "Must use C++ for the type iostream." But i am using C++. My frens says theres an option that allows u to either compile in C or C++. If that is true, where do i change it so that i can compile the following program.

#include <iostream>

 int main()
 { int i = 10, j=20;
     int k = (i+j)/2;
   std::cout << "i is " <<i
            <<" and j is " << j << std::endl;
   std::cout << "average is "<< k
                << std::endl;
   return 0;

 }

RE: Borland C++ 5.02

It runs in my mind that you shouldn't use the std:: with 5.02. It has something to do with how the standard was implimented in that version (I think). Try removing it from your program and recompiling, it should work then.

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.

RE: Borland C++ 5.02

I think you should in compiller settings set C++ node instead of C node. Also use extension cpp for C++ files.

John Fill


ivfmd@mail.md

RE: Borland C++ 5.02

(OP)
Errm..wat shld i use then to achieve the desired results if std:: is not supported? Is Borland C++ 5.02 the latest version? if it is then y is std:: not supported. if it is not the latest version, then wat is the latest version and does it support std::?

RE: Borland C++ 5.02

why you don't try without std::?

John Fill


ivfmd@mail.md

RE: Borland C++ 5.02

The latest version is 5.5. It is available for free from www.borland.com . You can also download a debugger for it, too. At the time 5.02 was written, the C++ standard was still being debated and DOS was still in use.

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.

RE: Borland C++ 5.02

By the way, I just tested your program with 5.5 and it compiled and ran just fine.

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.

RE: Borland C++ 5.02

hi there,

just try to change the node type from c to cpp as well as extension of ur source file must be *.cpp n it will work fine.

ComputerJin

RE: Borland C++ 5.02

A thought, in the mist of a dawn!!

I think that if the compiler demands that the file has a specific extension, then there is something wrong here!! Come one, it's just a plain text file!!
Sure, perhaps the compiler more easily senses whether it is a C++ or C program but I still think it’s a bit awkward!!

My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close