title: Reading from text files C++
body: <p>I have a text file containing three columns of numbers; one column each for the <code>x,y,z</code> coordinates of a bunch of points. All numbers are between <code>0</code> and <code>1</code>.</p>
  
  <p>I have created the following structure:</p>
  
  <pre><code>typedef struct 
  {
      double xcd, ycd, zcd;
  } point; 
  </code></pre>
  
  <p>I want to create a size-N array of structures of type <code>point</code>. Then I want to scan the text file line by line and for the <code>n</code>th particle, I want to put in the three numbers on the <code>n</code>th line into the respective <code>xcd</code>, <code>ycd</code> and <code>zcd</code> positions. </p>
  
  <p>Tell me if there is some efficeint way of going about this. </p>