<div class="gmail_quote">On Sat, Feb 20, 2010 at 8:42 AM, Giancarlo Amati <span dir="ltr">&lt;<a href="mailto:ilferraresebono@hotmail.it">ilferraresebono@hotmail.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div>
Hello Users,<br><br>is thre any functions in the std::string  which converts strings into correspondent numbers?<br><br>I mean &quot;123.40&quot; = double 123.40<br><br>Many thanks.<br>GC.<br><div class="hm">                                               </div>
</div></blockquote></div><div><br></div>You should use string streams:<br><div><br></div><div>#include &lt;sstream&gt;</div><div><br></div><div><div>  std::string strNumber = &quot;23.4&quot;;</div><div>  std::cout &lt;&lt; &quot;strNumber = &quot; &lt;&lt; strNumber &lt;&lt; std::endl;</div>
<div>  std::stringstream ss;</div><div>  ss &lt;&lt; strNumber;</div><div>  double dNumber;</div><div>  ss &gt;&gt; dNumber;</div><div>  std::cout &lt;&lt; &quot;dNumber = &quot; &lt;&lt; dNumber &lt;&lt; std::endl;</div>
<div><br></div>Thanks,<br><br>David</div>