how to convert? C-string format of toStirng()

<p>Here is the function:</p><pre><br /><code>string toString(){<br /> string tmp;<br /><br /> char buf[80];<br /> if (*d != 1)<br /> sprintf_s(buf, "%d/%d", *n, *d);<br /> else sprintf_s(buf, "%d", *n);<br /> tmp = string(buf);<br /><br /> return tmp;<br />}<br /></code><br /></pre><p>need a c-string format of toString(), don't know how to do; plz help.. char *str();</p><br /><h2>Click here view more answers <a href="http://ift.tt/20RXAjx">http://ift.tt/20RXAjx</a></h2>

Nhận xét

Bài đăng phổ biến từ blog này

Align div to bottom of the page in bootstrap

Align elements inside an tag vertically

Javascript is unable to stop page loading