home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10379 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.2 KB  |  41 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: 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
  3. From: abakker@cs.vu.nl (Arno BAKKER)
  4. Subject: Re: FOPEN command
  5. Message-ID: <BxAIv4.F8B@cs.vu.nl>
  6. Sender: news@cs.vu.nl
  7. Organization: Dept. of Computer Science, Vrije Universiteit Amsterdam
  8. References: <574.2AF8E8CC@mechanic.Fidonet.org>
  9. Date: Fri, 6 Nov 1992 10:37:51 GMT
  10. Lines: 29
  11.  
  12. >03 Nov 92, BL0528540-Bill Oswald  ALC2817 writes to All:
  13. >
  14. >        stream=fopen("c:\foo\afile", "r")
  15. >
  16. > The resulting executable works if afile is in the same directory
  17. > as the executable. If the above is correct the fopen command
  18. > should be able to find afile independant of where the executable
  19. > lives. But that does not seem to be the case. What am I doing wrong?
  20. > BTW, I am using borland c++ 3.1
  21. >
  22.  
  23. Since C uses the backslash as an escape character, it isn't the command
  24. that's wrong, it is the FILENAME!
  25. It should read:
  26.  
  27.     "c:\\foo\\afile"
  28.  
  29. Currently the compiler interprets \f and \a as escape sequences
  30. and thus messes up your string.
  31.  
  32. Hope this helps,
  33.  
  34.         Arno
  35.  
  36.         
  37. -- 
  38. ===========Arno BAKKER
  39. Department of Computer Science,
  40. Vrije Univeristeit Amsterdam, Holland.
  41.