delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/10/30/14:15:06

From: "A. Sinan Unur" <asu1 AT c-o-r-n-e-l-l DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problems with cout on Win98
Date: 30 Oct 2002 19:11:10 GMT
Organization: Cornell University
Lines: 37
Sender: asu1 AT cornell DOT invalid (on pool-141-149-209-161.syr.east.verizon.net)
Message-ID: <Xns92B790502C6E5asu1cornelledu@132.236.56.8>
References: <3dc0270e$1 AT news DOT swissonline DOT ch>
NNTP-Posting-Host: pool-141-149-209-161.syr.east.verizon.net
X-Trace: news01.cit.cornell.edu 1036005070 10661 141.149.209.161 (30 Oct 2002 19:11:10 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 30 Oct 2002 19:11:10 GMT
User-Agent: Xnews/5.04.25
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Felix Althaus" <felix DOT althaus AT swissonline DOT ch> wrote in news:3dc0270e$1
@news.swissonline.ch:

> Hello
> 
> I have a  problem compiling C++ programs under the DOS-Shell of Win98:
> I tried the following code:
> 
>     #include <iostream>
> 
>     int main()
>     {
> 
>     cout << "Hallo";
>     return 0;
>     }
> 
> 
> If I compile this, I get the follwing error:
> 
> C:\DJGPP>gxx testc.cpp
> testc.cpp: In function `int main()':
> testc.cpp:8: `cout' undeclared (first use this function)
> testc.cpp:8: (Each undeclared identifier is reported only once for each
> function it appears in.)
> testc.cpp:10:2: warning: no newline at end of file

in standard C++, cout lives in the std namespace. so use:

std::cout

Sinan.
-- 
A. Sinan Unur
asu1 AT c-o-r-n-e-l-l DOT edu
Remove dashes for address
Spam bait: mailto:uce AT ftc DOT gov

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019