public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: LLeweLLyn Reese <llewelly@lifesupport.shutdown.com>
To: MR <nimrod.bm@optusnet.com.au>
Cc: gcc-help@gcc.gnu.org
Subject: Re: RedHat 8.0 `istream_iterator' undeclared (first use this function)
Date: Sat, 24 May 2003 12:50:00 -0000	[thread overview]
Message-ID: <x3u1bk5x7h.fsf@lifesupport.shutdown.com> (raw)
In-Reply-To: <1053775198.2190.10.camel@nimrod>

MR <nimrod.bm@optusnet.com.au> writes:

> Hello STL gurus, 
> 
> 
> I have a bit of a problem getting my iterators to work with libstdc++
> 3.2-7 (redhat 8.0), GCC 3.2.
> 
> with a very simple program (merges two files):
> 
> #include <iostream>
> #include <fstream>
> #include <algorithm>

#include <iterator>

Stream iterators are in this header. See the <iterator> synopsis in
    24.2, or 24.5 .

> 
> using namespace std;
> 
> main(int argc, char**argv) {

int main(int argc, char**argv) {

>     if (argc < 3) {
> 
> 	cout << "You must supply two input files.\n";
> 
> 	exit(1);
>     }
> 
>     ifstream in1(argv[1]), in2(argv[2]);
>     if(!in1||!in2) {
> 	cout << "File open error\n";
> 	exit(1);
>     }
> 
>     merge(
> 	istream_iterator<float>(in1),
> 	istream_iterator<float>(),
> 	istream_iterator<float>(in2),
> 	istream_iterator<float>(),
> 	ostream_iterator<float>(cout, "\n")
>     );
>     return 0;
> }

      parent reply	other threads:[~2003-05-24 12:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-24  5:07 Segmentation fault Causes Daniel Bolgheroni
2003-02-24  5:22 ` J.C.Wren
2003-04-22  1:02 ` Daniel Bolgheroni
2003-04-22  7:47 ` bjorn rohde jensen
2003-04-22 18:24 ` Dikandé Alain Moïse
2003-05-24 11:07 ` RedHat 8.0 `istream_iterator' undeclared (first use this function) MR
2003-05-24 12:21   ` Oscar Fuentes
2003-05-24 12:50   ` LLeweLLyn Reese [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x3u1bk5x7h.fsf@lifesupport.shutdown.com \
    --to=llewelly@lifesupport.shutdown.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=nimrod.bm@optusnet.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).