public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* g++ conformance question
@ 2002-02-23 23:10 Gregory Haley
  0 siblings, 0 replies; only message in thread
From: Gregory Haley @ 2002-02-23 23:10 UTC (permalink / raw)
  To: gcc

Hi,

If I have addressed this question to the wrong address, please either
return it to me or forward it to the correct person.

I am trying to write a program that uses wcin and wcout to read in and
print out wchar_t type (actually 2 byte unicode characters).  A very
simple program looks like the following:

#include <iostream> 
#include <cwchar>

using namespace std;

int main()
{
   wchar_t uni;
   std::cout << "Enter a two byte value: ";
   wcin >> uni;

   wcout << uni << std::endl;

   return 0;
}

When I try to compile this, the compiler is complaing that wcin (and
wcout) are undeclared.  I sent a similar question to the ACCU's list,
and have been told this code will compile on Borland C++ Builder 5. I
have tried to compile this using both g++ 2.95.x and on a recently
installed g++ 3.0.3, with the same result.

So, do i need to compile while linking something into the compile step?

I've noticed in the documentation that there is something called the
ios_base.h header which appeared to tie the wcin, wcout, etc operators
together.  If I type a "locate ios_base" at my command prompt (on a Unix
box), I get no return (yet, for the 3.0.3 implementation on my Linux
box, the ios header is there, and I still cannot compile a program
contain wcin or wcout).

Your help (and this could be pointing me to the correct documentation!)
would be greatly appreciated.

Many thanks.

ciao!
greg.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-02-24  6:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-23 23:10 g++ conformance question Gregory Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).