I have a C-program (an Apache module, i.e. the program runs often), which is going to write()
a 0-terminated string over a socket, so I need to know its length.
sizeof
works at compile time
#define POLICY "\n" \
"\n" \
"\n" \
"\n" \
" \0"
char pol[sizeof POLICY];
strcpy(pol, POLICY); /* safe, with an extra char to boot */
If you need a pre-processor symbol with the size, just count the characters and write the symbol yourself :-)
#define POLICY_LENGTH 78 /* just made that number up! */