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: Compiling a program


Your code has an issue with it:  While you use the correct standard
header notation, you have left out one important detail.  cout is
located in the standard namespace, so you either have to add

using namespace std;

to tell the compiler where the name cout is defined or qualify the
name to tell where it comes from, i.e.

std::cout

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello";
};

This link will catch you up more fully on standard headers:

http://www.cplusplus.com/doc/ansi/hfiles.html

Wayne




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