I need to export several variables such that they look like the following in the command line
export ROS_HOSTNAME=xxx
How do I use setenv()
Do like this:
setenv("ROS_HOSTNAME", "xxx", true);
Note it's synopsis as well:
#include int setenv(const char *envname, const char *envval, int overwrite);
See this link for more details on setenv().
setenv()