title: Why is ParseFromString() not producing an output in my application using protobuf?
body: <p>I currently have a <code>*.cpp</code> file where I import the needed <code>*.proto.h</code> file and instantiate an object based on one of the messages(Heartbeat) from my <code>*.proto</code> file. My goal is to use the <code>set_value()</code>, <code>SerializeToString()</code>, and <code>ParseFromString()</code>.I've had success accomplishing the first two tasks. When using <code>ParseFromString()</code> not output is produced to the screen. I'm pretty new to <code>protobufs</code> so there may be something I'm overlooking. This is my code.</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &quot;cpnt.pb.h&quot;
  
  using namespace std;
  
  int main()
  {
      wombat::HeartBeat h;
  
      string m;
      string t;
      string v;
  
      h.set_value(1);
      v = h.SerializeToString(&amp;m);
      t  = h.ParseFromString(v);
  
      cout &lt;&lt; &quot;\n The message received is:&quot; &lt;&lt; h.value();
      cout &lt;&lt; &quot;\n The binary data stored in v is:&quot; &lt;&lt; v;
      cout &lt;&lt; &quot;\n The parsed data stored in t is:&quot; &lt;&lt; t &lt;&lt;::endl;
      return 0;
  
  }
  </code></pre>
  <p>And this is a printout of the output:</p>
  <p><a href="https://i.stack.imgur.com/pcH1d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pcH1d.png" alt="enter image description here" /></a></p>