Re: fopen in specific environments

Discussion in 'C Programming' started by Kevin Easton, Aug 12, 2003.

  1. Kevin Easton

    Kevin Easton Guest

    wrote:
    > Sorry to ask a semi implementation-dependent question, but I'm having some
    > trouble with fopen() in a Windows environment... I want to open a file a la
    >
    > FILE *f;
    > f=fopen( "L:\Apps\CTRemote\pairs", "r" );
    >
    > I know the file exists, but I can't seem to get it open like this - it doesn't
    > want to find the file.. If I use lower case letters, it says the syntax is
    > bad or something. Is there some stupid trick to this?


    Yes. \ is the escape character in C source - you known that if you have
    "\n" in a string, it's not literally ` \ ' then ` n ', right?

    f = fopen( "L:\\Apps\\CTRemote\\pairs", "r" );

    - Kevin.
     
    Kevin Easton, Aug 12, 2003
    #1
    1. Advertising

  2. Kevin Easton

    Guest

    Kevin Easton <> broke the eternal silence and spoke thus:
    > Yes. \ is the escape character in C source - you known that if you have
    > "\n" in a string, it's not literally ` \ ' then ` n ', right?


    I knew that - just managed to forget courtesy of Windows and their stupid
    backslashes... *sigh*

    --
    Christopher Benson-Manica | Jumonji giri, for honour.
    ataru(at)cyberspace.org |
     
    , Aug 12, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nonee
    Replies:
    2
    Views:
    2,659
    Neredbojias
    Oct 25, 2005
  2. fopen in specific environments

    , Aug 11, 2003, in forum: C Programming
    Replies:
    1
    Views:
    302
    Martin Ambuhl
    Aug 11, 2003
  3. =?Utf-8?B?SmF2?=

    Is ViwState Page-Specific or UserControl-Specific

    =?Utf-8?B?SmF2?=, Aug 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    551
    =?Utf-8?B?SmF2?=
    Aug 16, 2006
  4. Michel Rouzic
    Replies:
    4
    Views:
    1,837
    Michel Rouzic
    Apr 28, 2008
  5. mazdotnet
    Replies:
    2
    Views:
    412
    Alexey Smirnov
    Oct 2, 2009
Loading...

Share This Page