Dynamic allocation/ Pointer to Pointer to update an Array containing parameter
You may try something like this:

const char* topicArry[2] = {NULL, groupTopic};
const char** const pDeviceTopic = &amp;topicArry[0];
#define deviceTopic (*pDeviceTopic)


Arguably not very elegant, but now when you assign, e.g.

deviceTopic = msgTopic;


you are actually writing into topicArry[0].