Click to See Complete Forum and Search --> : # define MSG "bla.." where bla... is on 2 lines?


Cat123
September 14th, 2002, 11:49 AM
Hi,

Does anyone know how to do that or if it can be done? I want MSG to be a long paragraph.

# define MSG "bla bla bla bla
bla bla bla....."


Thank you!

cup
September 14th, 2002, 12:13 PM
Add a backslash for continuation. If it is a string, you can split the string over several lines

// lame example
#define tangent(x) \
sin(x) / \
cos(x)

// Remember to put a space after the "
#define PANGRAM \
"Xylophone wizard " \
"begets " \
"quick jive form"

Cat123
September 14th, 2002, 12:38 PM
Thank you! It works great :)

Cat

jfaust
September 14th, 2002, 02:08 PM
const char* MSG = "Prefer using global constants to macro defines.";


Jeff