This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: console out not working


ehab samir aziz <hpy_azizy@yahoo.com> writes:

> there is aproblem os using the command cout under gcc.
> How I use it . What is the name of the header file /

In ISO C++98 (that is, as of 5 years ago), cout is used like this:

#include<iostream>
#include<ostream>

int main()
{
    std::cout << "Hello!" << std::endl;
}

This example compiles correctly under every version of gcc >= 2.95 .

If you were not taught about namespaces, or about std::, which is the
    namespace all standard library functions and objects are in, your
    book or instructor has cheated you.

(If this is not your problem, please post a better description of your
    problem. )


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]