Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: C++ Probelm "iostream"  (Read 5539 times)

0 Members and 1 Guest are viewing this topic.

akil

    Topic Starter


    Rookie
    C++ Probelm "iostream"
    « on: December 02, 2007, 11:50:15 PM »
    Hi there,

    As I'm new to C++ I could not able to solve this follwing small probelm.

    #include <iostream>

    int main()
    {
       cout << "Welcome to the wonderful world of C++!!!\n";
       return 0;
    }


    I saved this file as testing.c and tired to complied and run it, but it showed twe error messages "unable to open include file 'iostream'" and "undefined symbol 'cout'  in function main<>"

    Then I saved as testing.cpp that's also shows the same error msgs.

    I'm using turbo C++ version 2

    It would be more appreciate if anyone give me the solution for my problem
    ***^^^NoThInG ImPoSSibLe To MaNKinD***^^^

    Tripti



      Rookie

      Re: C++ Probelm "iostream"
      « Reply #1 on: December 03, 2007, 05:15:49 AM »
      You should write
      #include<iostream.h>
      or
      #include<iostream>
      using namespace std;


      check it out. 8)

      Dilbert

      • Moderator


      • Egghead

      • Welcome to ComputerHope!
      • Thanked: 44
        Re: C++ Probelm "iostream"
        « Reply #2 on: December 05, 2007, 07:54:51 AM »
        Unless you're writing backwards-compatible code, you don't need to use iostream.h. Use Tripti's second solution.
        "The geek shall inherit the Earth."

        CarbonToast



          Greenhorn
        • I wonder if he is using the same wind we are using
        • Thanked: 1
          Re: C++ Probelm "iostream"
          « Reply #3 on: December 06, 2007, 10:34:43 PM »
          Turbo C++ 2.0 is a complete fossil, "namespace" wasn't even a keyword back then.  You will likely need to use the #include <iostream.h> version.  You should consider updating your compiler to something more recent (if at all possible).

          JamesBond

          • Guest
          Re: C++ Probelm "iostream"
          « Reply #4 on: December 10, 2007, 08:59:15 AM »
          #include <iostream>

          using namespace std;

          int main()
          {
              cout << "Welcome to the wonderful world of C++!!!\n";
              getchar();
          }