How to get total content of string?
<p>I have passed a printf formated string to a function and try to separate the content of that string by using sscanf(). But following is the problem with the use of this function.
i have called the function as follws:</p>

<pre><code>int var = -1;
ostringstream ossi;
ossi &lt;&lt; "myContent";
std::string detailString = "my first line \n
                            the secon dline content is alos present \n
                             also we are also get s sdjhf sf"
myFunction("What value: %d \n  My content: %s \n Detail Content: %s", var, ossi.str().c_str(),  detailString.c_str());
</code></pre>

<p>The implementation is as follows:</p>

<pre><code>void myFunction(const char * format, ...)
{

    int var;
    char myContent[10000];
    char detailContent[50000];
    if (sscanf(myString, "What value: %d \n My content: %s \n Detail Content: %s", &amp;var, cmyContent, detailContent) == 3)
    {
      std::cout&lt;&lt;" #### "&lt;&lt;std::endl;
      std::cout&lt;&lt;"var value is :"&lt;&lt;var&lt;&lt;std::endl;
      std::cout&lt;&lt;"My content is :"&lt;&lt;myContent&lt;&lt;std::endl;
      std::cout&lt;&lt;"detailContent is :"&lt;&lt;detailContent&lt;&lt;std::endl;
      std::cout&lt;&lt;" #### "&lt;&lt;std::endl;
    }
}
</code></pre>

<p>with above function im getting out put as follows:</p>

<pre><code>var value is : -1
My content is : myContent
detailContent is : my first line 
</code></pre>

<p>instead of getting total content of third argument(i.e detailContent) it gets only first line.
any suggestion to get complete content of string. 
Thansk in advance.</p>
