delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/16/23:32:19

From: Matthew Mastracci <mmastrac AT acs DOT ucalgary DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Init string question
Date: Sun, 16 Nov 1997 20:33:37 -0700
Organization: The University of Calgary
Lines: 37
Message-ID: <64odu1$mmc@ds2.acs.ucalgary.ca>
References: <3 DOT 0 DOT 32 DOT 19971115164202 DOT 00693068 AT 195 DOT 53 DOT 80 DOT 2>
NNTP-Posting-Host: mmastrac AT acs2 DOT acs DOT ucalgary DOT ca
Mime-Version: 1.0
In-Reply-To: <3.0.32.19971115164202.00693068@195.53.80.2>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sun, 16 Nov 1997, Jose Luis Perandones Colino wrote:

> I want a constant sting, but the string is very long, can i declare in
> multiple lines???
> 
> char text=" ... "
>            ^^^^^a very very long string(2000 chars)
> 
> i want split this in multiple lines.

Easy.  C can concatenate two string constants placed end-to-end without
any special operations.  For instance:

"blah" "foo"

is equivalent to:

"blahfoo"

And:

"la la"
" de dah"

is the same as:

"la la de dah"

Just break the string into managable bits and put them on separate lines.
Good luck!

/\/\att /\/\astracci                  mmastrac AT acs DOT ucalgary DOT ca

GCS/GE    d- s+:+ a--- C++++ UA P+ L E-- W+ N++ o K+ w+ O M- V 
          PS++ PE++ Y+ PGP t+++ 5+++ X++ R++ tv+ b+++ DI++++ I 
          G++ e h r* z?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019