Splitting of string
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/236129/c-how-to-split-a-string">C++: How to split a string?</a>  </p>
</blockquote>



<p>Hi friends,i need to split a string containing comma seperated values and have to store each value to a variable to use further in the program.I have my code as following : but 
i am getting error in my code :</p>

<pre><code>string myString = ........// i am getting the string from a function
string::iterator it = myString .begin();
while ( it != myString .end() )
 {
      if ( *it == ',' ) 
         {
           string element =*it++; //i can't do such type of conversion.but then how can 
                                    i get each value ?
           if(element.empty())
             {
             }
         } 
 }
</code></pre>
