Need help splitting a string thats being passed into a function in C++ : <p>I'm working on some code right now but am unable to do accomplish this task. The objective is to take a string that is passed through a function.
Example function:</p>

<pre><code>void function(string line1, string line2, string line3)
</code></pre>

<p>A string will be entered from the main function and it'll be passed into the first parameter "line1". The job of this function will be to "split the string to the closest whitespace character and put the first part of the string in line2, and the rest in line3.</p>

<p>For example if the string passed into line1 was:</p>

<pre><code>"Good Job"
</code></pre>

<p>I have to write some code that will split this string and assign each part to lines 2 and 3 so line2 = Good and line3 = Job.</p>
