title: Splitting char array
body: <p>I have a <code>char **names</code> array that basically stores names from a file.</p>
  
  <p>This is my <code>.txt</code> file</p>
  
  <pre><code>Mike, Sam, Stuart
  Andre, Williams, Phillips
  Patels, Khan, Smith
  </code></pre>
  
  <p>Basically, I want to split and store the names before the <code>,</code> character.
  For example, <code>Mike, Sam, Stuart</code> will become...</p>
  
  <pre><code>newName[0] = Mike
  newName[1] = Sam
  newName[2] = Stuart
  </code></pre>
  
  <p>I have something like this...</p>
  
  <pre><code>for (int i=0; i&lt;3; i++)
  {
    for (int j=60, j&gt;0; j--)
    {
       if(names[i][j] == ',')
       {
          cout &lt;&lt; j &lt;&lt; endl; //THIS PRINTS OUT THE POSITION. HOW CAN I STORE THE POSITION AND DO SOMETHING?
       }
    }
  }
  </code></pre>
  
  <p>I would appreciate it if someone could help me with my code, it is in the right direction. I don't want to use any <code>vectors</code> classes</p>
  
  <p>I have attempted to store marks of these students, however I want to add it to a <code>double *marks[2]</code> array.</p>
  
  <p>This is my <code>.txt</code> file...</p>
  
  <pre><code>69.9, 56.5
  29.8, 20.0
  35.6, 45.0
  </code></pre>
  
  <p>This is my code...</p>
  
  <pre><code>char **values;
  char * pch;
  pch = strtok (values[i], " ,");
  while (pch != NULL)
  {
      sscanf(pch, "%f, %f", &amp;marks[i][0], &amp;marks[i][1]);
      pch = strtok (NULL, " ,");
  }
  </code></pre>
  
  <p>I am getting random values such as <code>1.28277e-307</code> and <code>1.96471e+257</code></p>