cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/19/03:26:55

From: The Almighty Cheese <bmerry AT cssa DOT org DOT za>
Newsgroups: comp.os.msdos.djgpp
Subject: Help with ifstream
Date: Tue, 18 Mar 1997 21:24:56 +0200
Organization: Confusion
Lines: 19
Message-ID: <332EEC08.1BF1@cssa.org.za>
Reply-To: bmerry AT cssa DOT org DOT za
NNTP-Posting-Host: 196-7-124-101.iafrica.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi

I'm relatively new to C++, and I'm wondering how do do something: I've
got a text file with a line containing a single number. I want to
extract that number from the ifstream *and advance the file pointer to
the start of the next line to read a string*. I've looked at some of the
other member functions, and it seems that ignore (32767, '\n') should do
it, but that seems very cumbersome. What is the standard procedure for
doing this (the Pascal equivalent would be readln(inf, theVar);).

Thanks in advance
 
------------------------------------------------------------
| Bruce Merry aka The Almight Cheese | bmerry AT cssa DOT org DOT za  |
| http://www.cs.uct.ac.za/~bmerry/   | +27 21 720042       |
|                                    |                     |
| If Bill Gates was a robber, he'd not only shoot you, but |
| he'd charge you for the bullets as well.                 |
------------------------------------------------------------

- Raw text -


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