Re: Compiler Sometimes Not Handling Escape Sequences in C-Strings?
Re: Compiler Sometimes Not Handling Escape Sequences in C-Strings?
- Subject: Re: Compiler Sometimes Not Handling Escape Sequences in C-Strings?
- From: Cameron Hayne <email@hidden>
- Date: Mon, 28 Aug 2006 03:09:03 -0400
On 27-Aug-06, at 9:53 PM, Larry Bright wrote:
All the escaped newline characters appear as two characters in the
file - backslash followed by lower-case letter n. I have searched
the online documentation, re-read my most basic C books to confirm
that I'm not crazy and I still have no idea why the "escaping" of
the newline does not work.
Look at the compiled executable with 'hexdump -C' and see if the "\n"
characters appear in the executable as 0xa
They should.
For example:
% cat hello_world.c
#include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}
% hexdump -C hello_world | grep Hello
00001e20 48 65 6c 6c 6f 20 57 6f 72 6c 64 0a 00 00 00 00 |Hello
World.....|
--
Cameron Hayne
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden