title: Convert scanf to cin
body: <p>I am reading the following code: <a href="http://cgi.cse.unsw.edu.au/~xic/cgi-bin/evaluate.cpp" rel="nofollow">evaluate.cpp</a> from the following website: <a href="http://cgi.cse.unsw.edu.au/~xic/digits/" rel="nofollow">neural networr</a>
  I am trying to convert the following piece of code from <code>scanf</code> to <code>cin</code>:</p>
  
  <h2><strong>c:</strong></h2>
  
  <pre><code> for(int a=0;a&lt;64;a++) {
      if(scanf("%f+", &amp;NNetwork.InputUnits[a])!=1) {
          printf("Input Error!&lt;br&gt;\n"); return -1;
      }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>c++:</strong></p>
  
  <pre><code>for(int a=0;a&lt;64;a++) {
         cin &gt;&gt; NNetwork.InputUnits[a];
         if (NNetwork.InputUnits[a] != 1) {
              cout &lt;&lt; "Input Erro"; 
               return -1;
          }
      }
  </code></pre>
  
  <hr>
  
  <p>Is the following conversion correct?</p>