Re: Soft return in Xcode
Re: Soft return in Xcode
- Subject: Re: Soft return in Xcode
- From: Alastair Houghton <email@hidden>
- Date: Thu, 27 May 2010 10:24:26 +0100
On 27 May 2010, at 05:49, Shripada Hebbar wrote:
> You can split your lengthy literal by adding a backslash at each line ending
> and hit enter to go to next line. Note that, by doing this, the literal
> remains as is without newlines getting embedded.
>
> Something like this:
>
> Char * myStr = "This is really a lengthy\
> String literal that is being split\
> Into 3 lines";
As I mentioned, I think it's better to write
char *myStr = "This is a really lengthy "
"string literal that is being split "
"into 3 lines.";
because IIRC the backslash thing is an extension whereas the fact that adjacent string literals are concatenated by the compiler isn't.
FWIW, the concatenation also works for Objective-C strings using the @"" syntax.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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