• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Soft return in Xcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Soft return in Xcode (From: Shripada Hebbar <email@hidden>)

  • Prev by Date: Re: Soft return in XCode
  • Next by Date: Re: managing xcode projects vs going back to makefiles
  • Previous by thread: Re: Soft return in Xcode
  • Next by thread: Defining custom build configurations for multiple projects
  • Index(es):
    • Date
    • Thread