title: Easiest way to load variables from a text file
body: <p>I have a program where I want to load Variables from a text file to use them as default variables.</p>
  
  <p>The text file should look like this:</p>
  
  <pre><code>Name=No Name
  
  Age=8
  
  Gender=male
  
  etc.
  </code></pre>
  
  <p>Is there a simpler way and if not how do I do that in the place with the question marks?</p>
  
  <p>My Code look like this:</p>
  
  <pre><code>int Age;
  std::string Name;
  bool male;
  
  if(f.is_open())
  {
      while (!f.eof())
      {
  
          getline(f, line);
          if (line.find("Name=") == std::string::npos)
          {
              Name=?????;
              continue;
          }
          else if (line.find("Gender=") == std::string::npos)
          {
              if(????? == "true"); then
                 male=true;
              else
                 male=false;
  
              continue;
          }
          else if (line.find("Age=") == std::string::npos)
          {
              Age=?????;
              continue;
          }
          //etc. ...
  }
  f.close();
  </code></pre>