[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: What is the preferred way to embed multi-line string in C source?
- From: David Given <dg@...>
- Date: Fri, 19 Dec 2008 18:12:27 +0000
-----BEGIN PGP SIGNED MESSAGE-----
David Jones wrote:
> Yes, adjacent literal strings just get concatenated. The portable limit
> on the total length of the string as specified in the standard is 4095
> characters (in C99). If you are generating C code with a program you
> can easily go past this.
...but don't forget that a string array initialiser (const char foo =
"...") is not the same as a string literal (const char* foo = "..."),
and the limits don't apply to initialisers.
(Yes, I did have to work with a compiler that would crash if you went
beyond the length limit for literals.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----