want a "here doc" equivalent in "c"

L

LibraryUser

Pieter said:
Standard C knows nothing of 'embed', 'bash' or 'script'.


Ask this in comp.unix.programmer and prepare to be helped, or
rephrase the question to something not involving anything
platform-specific.

It is a perfectly valid C question, even though he is describing
the off-topic eventual use. The real question is "how to embed
all those characters within C source code", and the answer is to
use the escape character '\'.
 
T

Tom Rodman

Derk:

Thanks for your help - I'll use your approach; will write a
shell script filter to generate the meta-quoted strings in text[].

--
regards,
Tom Rodman
pls run for my address:
perl -e 'print unpack("u", "1\:6UP\,\$\!T\<F\]D\;6\%N\+F\-O\;0H\`");'

Derk wrote:
char *text[] = {
/*X*/
"line 1\n",
"line 2\n",
...,
"line n\n",
/*Y*/
0
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top