Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!usc!isi.edu!venera.isi.edu!jas From: jas@ISI.EDU (Jeff Sullivan) Newsgroups: comp.lang.c++ Subject: Borland C++ Streams question -- beginner Message-ID: <17621@venera.isi.edu> Date: 17 Apr 91 23:10:07 GMT Sender: news@isi.edu Distribution: comp Organization: USC-ISI Lines: 45 I'm just getting into Borland C++ and I'd like to use the Streams package they supply. Unfortunately, I've got to leap into this and try to get something big ported from perl right away, so I don't have the luxury of a lot of time to mosey through the manuals. I have an input file that looks like this: HEADER FIELD FIELD2 FIELD3 ... FIELDN -------------- --------------- ------- ------------- DATA1 DATA2 DATA3 DATAN And I don't know a priori how many fields there will be. I can use the ---- line as a format specifier, but to do this, I'd like to chop off that leading space. I tried this after opening the file as a ifstream called tmpin: char *tmpLine; tmpin.resetiosflags(ios::skipws); // I want to preserve WS tmpin >> ignore(1, '\n') >> tmpLine; I get the following errors: 1. 'resetiosflags' is not a member of 'ifstream' (I Know, but it's a stream manipulator, shouldn't it be accessible?) 2. Function 'ignore' should have a prototype in function 'main' (but ignore is defined as a member function of istream -- why isn't it being recognized as such?) Does anyone have any example code that does something real in Borland C++ with streams? jas -- -------------------------------------------------------------------------- Jeffrey A. Sullivan | Senior Systems Programmer jas@venera.isi.edu | Information Sciences Institute jas@isi.edu | University of Southern California