# define

can i define paths


  • Sure, go ahead.

    What do you mean by "path"? An access path to a directory or file? Those are just strings, so yes you can #define those, but a const char array is cleaner.
  • #define PATH C:windows

    Is this code is correct ?
  • Almost :) 2 problems with it:

    1. You'll want to put the path in "" since it's a text string.
    2. Since is an escape symbol, you need to put 2 of those if you want one backslash.

    Like this: [code]#define PATH "C:\windows\notepad.exe"[/code]
  • Thanks very much .
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!