delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/03/03:13:02

Message-ID: <38992143.5C63F443@home.comNOSPAM>
From: Robin Johnson <NOSPAMrobbat2 AT home DOT comNOSPAM>
Organization: Orbit Computers
X-Mailer: Mozilla 4.5 [en]C-AtHome0405 (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: ifstream constructor behavior
Lines: 26
Date: Thu, 03 Feb 2000 06:33:31 GMT
NNTP-Posting-Host: 24.113.36.103
X-Complaints-To: abuse AT home DOT net
X-Trace: news1.rdc1.bc.home.com 949559611 24.113.36.103 (Wed, 02 Feb 2000 22:33:31 PST)
NNTP-Posting-Date: Wed, 02 Feb 2000 22:33:31 PST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

This came up while I was trying to port some Turbo C++ to DJGPP:

void outline()
{     string S;
       ifstream f("test.txt",ios::nocreate)
       getline(f,S);
       cout << S;
    }

in TC this works fine, and S gets the correct value.
but in DJGPP, i need to use ios::nocreate||ios::in for the mode.
any particular reasons why?

I haven't tried the code on MSVC yet, but I will get a chance
tommorow to see if the effect is the same.

--
Robin Hugh Johnson
"Robbat2"
QTOD: "I used to be an idealist, but I got mugged by reality."
E-Mail     : robbat2 AT robbat2 DOT t-p-l DOT com
ICQ#       : 30269588 or 41961639
Home Page  : http://robbat2.t-p-l.com
Time Zone  : Pacific Daylight (GMT - 8)


- Raw text -


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