Article View: comp.os.msdos.programmer
Article #3365Re: FOPEN command
From: Arno BAKKER
Date: Fri, 06 Nov 1992 10:37
Date: Fri, 06 Nov 1992 10:37
29 lines
1297 bytes
1297 bytes
>03 Nov 92, BL0528540-Bill Oswald ALC2817 writes to All:
>
> stream=fopen("c:\foo\afile", "r")
>
> The resulting executable works if afile is in the same directory
> as the executable. If the above is correct the fopen command
> should be able to find afile independant of where the executable
> lives. But that does not seem to be the case. What am I doing wrong?
> BTW, I am using borland c++ 3.1
>
Since C uses the backslash as an escape character, it isn't the command
that's wrong, it is the FILENAME!
It should read:
"c:\\foo\\afile"
Currently the compiler interprets \f and \a as escape sequences
and thus messes up your string.
Hope this helps,
Arno
--
===========Arno BAKKER
Department of Computer Science,
Vrije Univeristeit Amsterdam, Holland.
Technical Details
Message-ID:
<BxAIv4.F8B@cs.vu.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!star.cs.vu.nl!abakkerReferences:
<574.2AF8E8CC@mechanic.Fidonet.org>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!star.cs.vu.nl!abakker From: abakker@cs.vu.nl (Arno BAKKER) Subject: Re: FOPEN command Message-ID: <BxAIv4.F8B@cs.vu.nl> Sender: news@cs.vu.nl Organization: Dept. of Computer Science, Vrije Universiteit Amsterdam References: <574.2AF8E8CC@mechanic.Fidonet.org> Date: Fri, 6 Nov 1992 10:37:51 GMT Lines: 29