Is there an equivalent readline().split() python function in C++?
<p>Essentially, the</p>

<pre><code>int main( int argc, char** argv )
</code></pre>

<p>does exactly that (or to a very close extent). I was wondering if I could replicate the functionality of the <code>int main( ... )</code> with other functions as well. For example, say I have a </p>

<pre><code>readline();
</code></pre>

<p>function that reads a line from a file. I would like to know how many arguments the line contained <code>argc</code>, as well as an array to each argument that (where a space in the line represents a new argument) <code>argv</code>. So I have two questions:</p>

<ol>
<li>Does such a function exist in C++ other than the <code>int main()</code> function?</li>
<li>If not, would it be difficult to write one. If the answer to this one is also no, I'd love to hear a few pointers on where to start. I'm not that experienced with C++ and I wasn't sure whether the <code>string</code> class has anything with this functionality.</li>
</ol>

<p>Thanks!</p>
