how to use string in va_start?
<p>for some reason, i cant get this working:</p>

<pre><code>    void examplefunctionname(string str, ...){
...
    va_start(ap, str.c_str());
</code></pre>

<p>nor do i get this work:</p>

<pre><code>    void examplefunctionname(string str, ...){
...
    int len = str.length();
    char *strlol = new char[len+1];
    for(int i = 0; i &lt; len; i++){
        strlol[i] = str[i];
    }
    strlol[len] = 0;
    va_start(ap, strlol);
</code></pre>

<p>but this does:</p>

<pre><code>    void examplefunctionname(const char *str, ...){
...
    va_start(ap, str);
</code></pre>

<p>could someone show me how i can use string instead of <code>const char *</code> there?</p>

<p>its outputting random numbers when i call <code>examplefunctionname("%d %d %d", 1337, 1337, 1337)</code></p>
