home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.help
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!troy
- From: troy@cqs.washington.edu (Troy Frever)
- Subject: a very simple question
- Message-ID: <troy.724620496@buck>
- Sender: news@u.washington.edu (USENET News System)
- Organization: University of Washington
- Date: Thu, 17 Dec 1992 19:28:16 GMT
- Lines: 24
-
- I apologize in advance for what is undoubtedly a very simple question
- from a novice (myself). I have a short program which compiles and
- executes using CC (on my Sun Sparc2) but which I am unable to compile
- using g++. The program is:
-
- #include <iostream.h>
- main()
- {
- int index = 10;
-
- cout << "The hex value of index is " << hex << index << "\n";
- }
-
- The error message is:
-
- g++ -g -o test test.cc
- test.cc: In function `int main ()':
- test.cc:7: undefined ostream operator << ()
-
- Why is it gagging on the "hex" manipulator (it works if I remove it),
- and how do I correct it? Please reply directly to me. Thanks.
-
- Troy Frever
- troy@u.washington.edu
-