title: Reading a specific part of a text file in C++
body: <p>I'm reading a file with <code>&lt;fstream&gt;</code>, and said file contains lines like this:</p>
  
  <pre><code>Name=Cecil
  Age=34
  Born=London
  //etc.
  </code></pre>
  
  <p>For the sake of the example, lets say I would like to assign <code>34</code> to the variable <code>int age</code>. This would mean that I have to find which line starts with <code>Age</code>, and then extract the value <code>34</code> after the equal sign.</p>
  
  <p>Later on I would like to alter this value in the program, and replace it in the file, so <code>34</code> would become  for example <code>35</code>, so again, I have to find this specific part of the file and write there.</p>
  
  <p>It seems like a basic task, yet I couldn't find any good examples so far. Maybe it would be better to store my data as JSON or XML and use a library for this purpose?</p>