cout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Durga

    cout

    Hi,

    What is lib file of cout & endl funtions?
    I included "iostream" also.
    Still I am getting this error.


    ERROR: C:\MyApp\consol e.cpp(10): error C2065: 'cout' : undeclared identifier


    --
    Thanks & Regards,
    Durga.
  • William DePalo [MVP VC++]

    #2
    Re: cout

    "Durga" <Durga@discussi ons.microsoft.c om> wrote in message
    news:608DCA92-16BA-482D-99FA-7CC446E14D2A@mi crosoft.com...[color=blue]
    > What is lib file of cout & endl funtions?
    > I included "iostream" also.
    > Still I am getting this error.
    >
    >
    > ERROR: C:\MyApp\consol e.cpp(10): error C2065: 'cout' : undeclared
    > identifier[/color]

    Well, if you have this line

    #include <iostream>

    in your source

    before you make any reference to the output stream, your problem may be due
    to an improper use of the precompiled-header feature.

    As a test, I'd turn off the pre-compiled header option and rebuild your
    project. If that solves the problem, you can read up on the proper use of
    the option and post questions about it here.

    Regards,
    Will


    Comment

    • Bruno van Dooren

      #3
      Re: cout

      [color=blue]
      > What is lib file of cout & endl funtions?
      > I included "iostream" also.
      > Still I am getting this error.
      >
      >
      > ERROR: C:\MyApp\consol e.cpp(10): error C2065: 'cout' : undeclared
      > identifier
      >[/color]

      did you do this:

      #include <iostream>
      using namespace std;

      cout is in the std namespace. if you do not tell the compiler to use that
      namespace, it will not find cout.
      another way is to explicitly resolve the namespace by using std::cout in
      your code.

      --

      Kind regards,
      Bruno van Dooren
      bruno_nos_pam_v an_dooren@hotma il.com
      Remove only "_nos_pam"


      Comment

      Working...