title: How to use setenv() to export a variable in c++?
body: <p>I need to export several variables such that they look like the following in the command line</p>
  
  <pre><code>export ROS_HOSTNAME=xxx
  </code></pre>
  
  <p>How do I use setenv() in c++ to achieve that?</p>
  
  <p>Thanks.</p>