title: How can i set my environment variable in c++ without passing command line argument
body: <p>I am using execv to set environment variable by passing command line argument. how to set environment variable without passing command line argument.</p>
  
  <pre><code>std::vector&lt;char*&gt; arg;
  arg.push_back("export MONGODB_HOSTNAME=" + mongodb_host + ";");
  arg.push_back("export MONGODB_USERNAME=" + mongo_username + ";");
  arg.push_back("export MONGODB_PASSWORD=" + mongo_passowrd + ";"); 
  arg.push_back("NULL");
  execv("/usr/bin/ssh", &amp;arg.front());
  </code></pre>