escapping \n, \t etc.
- From: "Prasad" <prasadjoshi124@xxxxxxxxx>
- Date: 13 Jan 2007 11:34:01 -0800
Hi All,
If the string is say, str = "Hello\nWorld" ;
Now, when I call printf ( "%s", str) ;
It is printed as
Hello
World.
But I want it to be printed as "Hello\nWorld". Hence, I need to escape
the \n with an extra \ ie. \n should be replaced with \\n.
What is the best way to do it? for all \n, \t, \b etc
Thanks and regards,
Prasad.
.
- Follow-Ups:
- Re: escapping \n, \t etc.
- From: Richard Heathfield
- Re: escapping \n, \t etc.
- Prev by Date: Re: Draft Secure C
- Next by Date: Re: Draft Secure C
- Previous by thread: Isn't it time there was a standard align statement?
- Next by thread: Re: escapping \n, \t etc.
- Index(es):