[Sussex] String macros in C/C++

Rupert Swarbrick rupert.swarbrick at lineone.net
Fri May 27 17:47:39 UTC 2005


I hope that this is an acceptable list to post this question to - I
decided that after all the questions about valgrind had been answered,
someone would at least know the answer!

I'm writing a program using autotools that installs various data files,
including a .glade interface into a share directory.

I know that the path to the data is something like:
"/DATADIR/PACKAGE/mainwnd.glade"

Using something like ostringstream or snprintf, I can concatenate the
defines together to get the right path, but it feels ungainly -
especially as all the information is available at compile time, so why
compute the answer at runtime.

The question is: Is there a way to concatenate strings in something like
a #define in C++?

Any ideas (or knowledgeable answers) gratefully appreciated,

Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 374 bytes
Desc: OpenPGP digital signature
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20050527/a5b43979/attachment.pgp 


More information about the Sussex mailing list