<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: How to Convert string to Number</title>
	<atom:link href="http://cppkid.wordpress.com/2008/09/02/how-to-convert-string-to-number/feed/" rel="self" type="application/rss+xml" />
	<link>http://cppkid.wordpress.com/2008/09/02/how-to-convert-string-to-number/</link>
	<description>Sharing my ideas</description>
	<lastBuildDate>Fri, 27 Nov 2009 08:11:02 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: eden88</title>
		<link>http://cppkid.wordpress.com/2008/09/02/how-to-convert-string-to-number/#comment-149</link>
		<dc:creator>eden88</dc:creator>
		<pubDate>Mon, 07 Sep 2009 21:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://cppkid.wordpress.com/?p=50#comment-149</guid>
		<description>ur code are very useful~~thx!!!</description>
		<content:encoded><![CDATA[<p>ur code are very useful~~thx!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Get Six Pack Fast</title>
		<link>http://cppkid.wordpress.com/2008/09/02/how-to-convert-string-to-number/#comment-132</link>
		<dc:creator>How to Get Six Pack Fast</dc:creator>
		<pubDate>Wed, 15 Apr 2009 14:52:01 +0000</pubDate>
		<guid isPermaLink="false">http://cppkid.wordpress.com/?p=50#comment-132</guid>
		<description>If you   want to hear a reader&#039;s feedback :) , I rate this post for four from five. Detailed info, but I just have to go to that damn yahoo to find the missed bits. Thank you, anyway!</description>
		<content:encoded><![CDATA[<p>If you   want to hear a reader&#8217;s feedback <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  , I rate this post for four from five. Detailed info, but I just have to go to that damn yahoo to find the missed bits. Thank you, anyway!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nibu Thomas</title>
		<link>http://cppkid.wordpress.com/2008/09/02/how-to-convert-string-to-number/#comment-125</link>
		<dc:creator>Nibu Thomas</dc:creator>
		<pubDate>Wed, 04 Mar 2009 09:44:21 +0000</pubDate>
		<guid isPermaLink="false">http://cppkid.wordpress.com/?p=50#comment-125</guid>
		<description>stringstream is a heavy class to be used just for number conversion. A simple sizeof(strinstream) gives 140 bytes. Also it&#039;s a buffered stream which is too much for a simple number conversion. :) Well this IMO. ;)</description>
		<content:encoded><![CDATA[<p>stringstream is a heavy class to be used just for number conversion. A simple sizeof(strinstream) gives 140 bytes. Also it&#8217;s a buffered stream which is too much for a simple number conversion. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Well this IMO. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: great</title>
		<link>http://cppkid.wordpress.com/2008/09/02/how-to-convert-string-to-number/#comment-42</link>
		<dc:creator>great</dc:creator>
		<pubDate>Wed, 01 Oct 2008 04:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://cppkid.wordpress.com/?p=50#comment-42</guid>
		<description>grat!!thansk soo much</description>
		<content:encoded><![CDATA[<p>grat!!thansk soo much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahsan</title>
		<link>http://cppkid.wordpress.com/2008/09/02/how-to-convert-string-to-number/#comment-13</link>
		<dc:creator>Ahsan</dc:creator>
		<pubDate>Wed, 03 Sep 2008 09:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://cppkid.wordpress.com/?p=50#comment-13</guid>
		<description>std::stringstream is definitely better over sprintf.

There is still a more better approach using the boost conversion library.

You can also use boost::lexical_cast for the same purpose.

#include 

std::string value = &quot;123.456&quot;;
float f = boost::lexical_cast(value);

The additional benefit is that when you use stringstream to convert an incorrect number (e.g if the string is &quot;abc.def&quot; and you try to convert it to number), you will get a wrong result.

boost::lexical_cast throws a boost::bad_lexical_cast exception when the conversion may not succeed.

http://www.boost.org/doc/libs/1_36_0/libs/conversion/lexical_cast.htm</description>
		<content:encoded><![CDATA[<p>std::stringstream is definitely better over sprintf.</p>
<p>There is still a more better approach using the boost conversion library.</p>
<p>You can also use boost::lexical_cast for the same purpose.</p>
<p>#include </p>
<p>std::string value = &#8220;123.456&#8243;;<br />
float f = boost::lexical_cast(value);</p>
<p>The additional benefit is that when you use stringstream to convert an incorrect number (e.g if the string is &#8220;abc.def&#8221; and you try to convert it to number), you will get a wrong result.</p>
<p>boost::lexical_cast throws a boost::bad_lexical_cast exception when the conversion may not succeed.</p>
<p><a href="http://www.boost.org/doc/libs/1_36_0/libs/conversion/lexical_cast.htm" rel="nofollow">http://www.boost.org/doc/libs/1_36_0/libs/conversion/lexical_cast.htm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How To Convert a Number To std::string &#171; My Experiments with C++</title>
		<link>http://cppkid.wordpress.com/2008/09/02/how-to-convert-string-to-number/#comment-10</link>
		<dc:creator>How To Convert a Number To std::string &#171; My Experiments with C++</dc:creator>
		<pubDate>Tue, 02 Sep 2008 13:00:36 +0000</pubDate>
		<guid isPermaLink="false">http://cppkid.wordpress.com/?p=50#comment-10</guid>
		<description>[...] Click to see how to convert string to number Possibly related posts: (automatically generated)How to avoid unwanted stepping in debugging with visual studio [...]</description>
		<content:encoded><![CDATA[<p>[...] Click to see how to convert string to number Possibly related posts: (automatically generated)How to avoid unwanted stepping in debugging with visual studio [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
