Thread: Copying a file from a variable?

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Indeed, so your example fails and it also proves that you should not use / in Windows.

    I found a little quote in the doc:
    Note Functions in the Windows API convert "/" to "\" as part of converting the name to an NT style name.
    So / works for paths with API, but not outside. So it's highly recommended not to use / for paths.
    I don't know if WINE emulates this behavior, as well.
    Using / for paths has always annoyed me anyway for some reason.
    Last edited by Elysia; 01-27-2008 at 02:11 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I always use "/" for paths unless I plan on using that path in a system() call, which isn't very often. I just hate having to use "\\" all the time.
    Plus, if I'm writing platform independent code and relative paths, using "/" will work on Windows & UNIX.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. copying binary file
    By samc2004 in forum C Programming
    Replies: 5
    Last Post: 12-09-2003, 01:34 PM
  5. Variable Allocation in a simple operating system
    By awkeller in forum C Programming
    Replies: 1
    Last Post: 12-08-2001, 02:26 PM