CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2001
    Posts
    2

    Read escape sequences from FILE

    Does anybody know how to read from file a string with escape character like '\n' ?

    Of course I don't want to read the caracter '\' followed by 'n' but keep the espace C character into the destination buffer.

    Do I really need to write a parser that should translate '\n' and other escape sequences into hexa code ??

    Thanks!!

  2. #2
    Join Date
    May 2000
    Location
    Birmingham, England
    Posts
    213

    Smile

    It really depends on how you read the file, most will automatically
    read the escape character. However some functions like fgets will
    'eat' the newline character as its pressence is implied at the end
    of the string since it performs a dleimited get on that character

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured