Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!labc.enet.dec.com!wallis From: wallis@labc.enet.dec.com (Barry L. Wallis) Newsgroups: comp.lang.c++ Subject: Re: Turbo C++ 2.0 compatability with older version? Summary: Help with C++ streams Message-ID: <14500@shlump.nac.dec.com> Date: 11 Aug 90 14:32:47 GMT Sender: newsdaemon@shlump.nac.dec.com Organization: Digital Equipment Corporation Lines: 48 In article <12838@rouge.usl.edu>, pcb@gator.cacs.usl.edu (Peter C. Bahrs) writes... >I am trying to recompile some C++ code with the new 2.0 turbo >compiler. There are a bunch of errors regarding the use of >filebuf with open and ostream with << ????? > >The books only say how to migrate to 2.0 unless I missed something. > >I have selected the medium memory model, add the file prog1.cpp and the >library oldstrmm.lib to the project file and tried to compile...ERRRRROOOR > >I turned default libs off....ERRRRROOR >The chunk of code that barfs looks like: > >#include > >filebuf f; >f.open ("thisfile", input); > >istream i(&f); > > >This works on all other non 2.0 compilers I have (AT&T GNU Zortech). > >Any ideas? > Yes. You are using the older stream format. If you want to continue doing that you should read the file OLDSTR.DOC. However, should you want to upgrade to the 2.0 version read pages 183-185 (admittedly, there is not much there) in the Turbo C++ Programmer's Guide. If, OTOH, your goal is to write 2.0 style streams, the following code should accomplish what you are trying to do: #include ifstream i("thisfile"); It may help you to look in the Turb C++ Getting Started manual as well (pages 184-193). --- Barry L. Wallis USENET: wallis@labc.dec.com Database Consultant Prodigy (don't laugh): DNMX41A U.S. DECtp Resource Center DECUServe: EISNER::WALLIS (not on the net yet) Los Angeles, CA "No one voted for me, I represent myself" ---