Click to See Complete Forum and Search --> : Read escape sequences from FILE


AnthoB
May 22nd, 2002, 07:43 AM
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!!

Stitch
May 22nd, 2002, 08:47 AM
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