Defining File Paths

This is a discussion on Defining File Paths within the C++ Programming forums, part of the General Programming Boards category; Is it valid to have something like Code: #define "C:\Program Files\Something Or would it treat the \P like a \n ...

  1. #1
    CV3
    CV3 is offline
    Registered User
    Join Date
    Aug 2004
    Posts
    9

    Defining File Paths

    Is it valid to have something like

    Code:
    #define "C:\Program Files\Something
    Or would it treat the \P like a \n or \t?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,205
    Yes '\P' would be treated specially, use \\

  3. #3
    #include<xErath.h> xErath's Avatar
    Join Date
    Jun 2004
    Posts
    722
    Code:
    #define "C:\\Program Files\\Something

  4. #4
    CV3
    CV3 is offline
    Registered User
    Join Date
    Aug 2004
    Posts
    9
    Thanks alot.

    So I need "C:\\Program Files..."?

  5. #5
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,088
    Yes...

    or "C:/Program Files..." would also work, since Windows can handle backslashes as well as forward slashes.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  4. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21