Getline-removing colon and dealing with extra line
<pre><code> struct studentinfo
  { 
     string name;
     CompClass class_taken;
     CompClass class_TA;
  };       

 struct CompClass {
    string class_num;
    string class_sem;
  };
</code></pre>

<p>The input information that will be inputted looks like this...
   John.Smith:15:S13</p>

<p>I have separated the 15(class number) and the S13(class semester), but would   like to keep them as one entire course called Course instead of string num and string sem. However, I'm not sure how to get rid of the colon while doing so. How can i manipulate my code below so it takes care of the colon issue?  </p>

<pre><code>while(getline(file_one, array[i].name, ':')){           
        getline(file_one,array[i].class_taken.num,':');
        getline(file_one,array[i].class_taken.sem,'\n');
        i++;
}
</code></pre>

<p>UPDATE: i've kept them separate and now am trying to combine them into a single string...What's wrong with my code below though. The output is skipping some of the lines...</p>

<pre><code>  for(int i=0; i&lt;10; i++){
    string course="";
    string num;
    string sem;
    num = array[i].class_taken.class_num;
    sem = array[i].class_taken.class_sem;
    course += num;
    course += sem;
    array[i].class_taken.course = course;
    i++;
}   
</code></pre>