Using Cosm, How can I insert #define text into a string ?

Hi,

I want to add some text that I have previously defined into a string, I have tried all evening, but cannot work out how do it ?

Original string
Cosm_client.publish("Vt7C1Sjuz9elWSAKxZdmhHTVl0alFuVT0g/v2/feeds/00077/datastreams/Outside_Temperature.csv ",buffer);

Now my defines:
#define Cosm_key Vt7C1Sjuz9elWSAKxZdmhHTVl0alFuVT0g
#define Cosm_feed 00077

I know this isn't correct but just shows what I am trying to do:
Cosm_client.publish("Cosm_key/v2/feeds/Cosm_feed/datastreams/Outside_Temperature.csv ",buffer);

How can i insert the defines to be the same as the long string, as the original ?

Thanks

Regards

Gary

#define names are substituted only when the text appears as a literal - not inside of strings.

You are better off using const char * and sprintf().

const char *Cosm_key = "Vt7C1Sjuz9elWSAKxZdmhHTVl0alFuVT0g";
const char *Cosm_feed = "00077";
char cosm_buff[80];
sprintf(cosm_buff, "%s/v2/feeds/%s/datastreams/Outside_Temperature.csv", Cosm_key, Cosm_feed);

Then, use cosm_buff in the publish() call.