title: C++ snprintf "cannot pass objects of non-POD type"
body: <p>I am trying to write a program that has a config and key file. The config file reads what ever is inputted into the key file, parses and executes the key values as needed.</p>
  
  <p>I am getting an error: warning: cannot pass objects of non-POD type ‘struct std::string’ through ‘...’; call will abort at runtime.</p>
  
  <p>I am receiving the error on this line:</p>
  
  <pre><code>snprintf(command, 256, "tar -xvzf %s %s", destination, source);
  system(command);
  </code></pre>
  
  <p>More of the code to try and better explain:</p>
  
  <pre><code>std::string source = cfg.getValueOfKey&lt;std::string&gt;("source");
  std::string destination = cfg.getValueOfKey&lt;std::string&gt;("destination");
  int duration = cfg.getValueOfKey&lt;int&gt;("duration");
  int count, placeHolder, placeHolderAdvanced;
  count = 1;
  char command[256];
  
  snprintf(command, 256, "tar -xvzf %s %s", destination, source);
  system(command);
  
  //Creates folder 1.
  snprintf(command, 256, "mkdir %i", count);
  system(command);
  
  //Removes the last folder in the group.
  snprintf(command, 256, "rm -rf %i", duration);
  system(command);
  </code></pre>
  
  <p>Any suggestions on what I am doing wrong, or where I should be looking?</p>
  
  <p>Thank you!</p>