Escape sequence \ in C lang.

Hi all, a lil help here please, what is the purpose of the Escape Sequence '\' in C language? and how and where to use it? Thanks.

2.4 Ghz intel core2 Duo MBP 17" 4 GB SDRAM, 160GB HD,, Mac OS X (10.5.6), w-keyboard, w-mighty mouse, 5G 60GB IPOD, X-BOX360

Posted on Mar 2, 2009 7:25 PM

Reply
3 replies

Mar 2, 2009 7:39 PM in response to Merged Content 1

The backslash is commonly used to escape itself, to form octal or hex constants and several control characters. For example:
{code}
#define PATH "C:\\Temp\\Download" // escaped Windows path separators
#define MAX \xFFFF // hex constant
#define MIN \01 // octal constant
printf("\t\tHello World\n"); // 2 tabs and new line
printf("\fPage 2\n"); // form feed and new line
{code}
Let me know if you need the complete list from the C spec.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Escape sequence \ in C lang.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.