title: How to store points (coordinates x,y) from a text file in c++ then calculate/display the number of points in that file
body: <p>This is what i have done so far , but then I am stuck on how to display x,y or count the number of points in that file. So let's assume we have these points with test1.txt :</p>
  
  <pre><code>0,1
  0,4
  6,3
  2,4
  5,4
  5,6
  6,4
  5,4
  </code></pre>
  
  <p>Thank you </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  typedef struct
  {
      int x;
      int y; 
  } point;
  
  int main()
  {
      ifstream input;
      string filename;
      cout &lt;&lt; "Enter the file name :" &lt;&lt; endl;
      cin &gt;&gt; filename;
      input.open(filename.c_str());
  
      while(input.fail())
      {
          input.clear();
          cout &lt;&lt;"Incorrect filename, please enter again" &lt;&lt; endl;
          cin &gt;&gt; filename ;
          input.open(filename.c_str()) ;
      }
      vector&lt;point&gt; points;
      point tmp;
      while (input &gt;&gt; tmp.x &amp;&amp; input &gt;&gt; tmp.y)
      {
          points.push_back(tmp);
      };       
      cout &lt;&lt; points.size() &lt;&lt; endl;       
      return 0;
  }
  </code></pre>