The easiest way is to use Tcl_LinkVar to couple the char* variable in C++ (std::string not supported) to Tcl. Like that, all you have to do is change the C++ variable and call Tcl_UpdateLinkedVar to allow Tcl to notice that the variable has changed. You do not need to use Tcl_UpdateLinkedVar if you never have any traces set on the variable, but they're actually quite a common mechanism so doing the call is advised. Be aware that Tcl_UpdateLinkedVar is a reentrant call to the Tcl interpreter; some care should be taken to ensure that any traces you run do not trigger a loop back into your code…
// Setup (done once)...
Tcl_LinkVar(interp, "XXX", &XXX, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
// Your code ...
if(CONDITION==1)
XXX = "FLOODING";
if(CONDITION==2)
XXX = "AODV";
// Notify Tcl ...
Tcl_UpdateLinkedVar(interp, "XXX");
If you want the setting of the Tcl variable XXX to change the C++ variable XXX, you need to take extra care. Drop the use of the TCL_LINK_READ_ONLY and ensure that you always use ckalloc to allocate memory for the strings in XXX (because Tcl will use the matched ckfree to dispose of the old one when setting the C++ variable).