<?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/"
		>
<channel>
	<title>Comments on: 13.3 &#8212; Output with ostream and ios</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Emiel</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-94934</link>
		<dc:creator>Emiel</dc:creator>
		<pubDate>Wed, 17 Nov 2010 17:45:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-94934</guid>
		<description>Great tutorials. I&#039;ve read them all so far.

However, at the boolalpha example on this page I noticed 0 represents true and 1 represents false?

0 1 --&gt; should be 1 0
true false
0 1 --&gt; should be 1 0
true false

I ran the example code to be sure (my world would collapse if true was 0 :P).</description>
		<content:encoded><![CDATA[<p>Great tutorials. I&#8217;ve read them all so far.</p>
<p>However, at the boolalpha example on this page I noticed 0 represents true and 1 represents false?</p>
<p>0 1 &#8211;&gt; should be 1 0<br />
true false<br />
0 1 &#8211;&gt; should be 1 0<br />
true false</p>
<p>I ran the example code to be sure (my world would collapse if true was 0 :P).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cpp-learner</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-86254</link>
		<dc:creator>cpp-learner</dc:creator>
		<pubDate>Thu, 10 Jun 2010 04:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-86254</guid>
		<description>Looking forward to see sections on vector, map, iterators, etc... There are many available sources online but I know when Alex write it it will be the best</description>
		<content:encoded><![CDATA[<p>Looking forward to see sections on vector, map, iterators, etc&#8230; There are many available sources online but I know when Alex write it it will be the best</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rsmorph</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-77234</link>
		<dc:creator>rsmorph</dc:creator>
		<pubDate>Tue, 26 Jan 2010 19:16:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-77234</guid>
		<description>I was stuck with the same problem. From the info i&#039;ve gathered, the number of digits displayed in the exponent in scientific notation is implementation dependent, meaning it depends on the machine you are using.</description>
		<content:encoded><![CDATA[<p>I was stuck with the same problem. From the info i&#8217;ve gathered, the number of digits displayed in the exponent in scientific notation is implementation dependent, meaning it depends on the machine you are using.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinny</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-68436</link>
		<dc:creator>Vinny</dc:creator>
		<pubDate>Wed, 16 Sep 2009 12:55:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-68436</guid>
		<description>Excellent Site. I am setting a book mark. I tried your examples and everything works fine. I would also like to reset the floating point precision back to its default. I am writing a library routine. I don&#039;t know what the user will have for their default precision but it would be great to capture it, change the precision to my own, then reset it back.
Thanks,
Vinny</description>
		<content:encoded><![CDATA[<p>Excellent Site. I am setting a book mark. I tried your examples and everything works fine. I would also like to reset the floating point precision back to its default. I am writing a library routine. I don&#8217;t know what the user will have for their default precision but it would be great to capture it, change the precision to my own, then reset it back.<br />
Thanks,<br />
Vinny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-31817</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 08 Nov 2008 19:33:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-31817</guid>
		<description>I&#039;m not sure you can adjust that in scientific notation format.  If there is a way I&#039;m not aware how.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure you can adjust that in scientific notation format.  If there is a way I&#8217;m not aware how.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hugh</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-31671</link>
		<dc:creator>Hugh</dc:creator>
		<pubDate>Wed, 05 Nov 2008 20:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-31671</guid>
		<description>So, how do you go about adjusting the size of the exponent from 3 digits to 2? I have a floating point number that I want outputted as 0.000E+00 instead of 0.000E+000.

Any ideas?

Thanks</description>
		<content:encoded><![CDATA[<p>So, how do you go about adjusting the size of the exponent from 3 digits to 2? I have a floating point number that I want outputted as 0.000E+00 instead of 0.000E+000.</p>
<p>Any ideas?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 13.4 &#8212; Stream classes for strings</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-27036</link>
		<dc:creator>Learn C++ - &#187; 13.4 &#8212; Stream classes for strings</dc:creator>
		<pubDate>Thu, 11 Sep 2008 06:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-27036</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 13.3 &#8212; Output with ostream and ios &#124; Home &#124; 13.5 &#8212; Stream states and input validation &#187;     Tuesday, March 18th, 2008 at [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 13.3 &#8212; Output with ostream and ios | Home | 13.5 &#8212; Stream states and input validation &raquo;     Tuesday, March 18th, 2008 at [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-27033</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 11 Sep 2008 06:38:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-27033</guid>
		<description>I am personally not a fan of the C++ I/O operators for outputting formatted numbers.  In those cases, I usually fall back to the old C-style stdio printf() function way of doing things.  Thanks for noting the errors.</description>
		<content:encoded><![CDATA[<p>I am personally not a fan of the C++ I/O operators for outputting formatted numbers.  In those cases, I usually fall back to the old C-style stdio printf() function way of doing things.  Thanks for noting the errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grant</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-26238</link>
		<dc:creator>Grant</dc:creator>
		<pubDate>Thu, 04 Sep 2008 09:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-26238</guid>
		<description>Hi Alex,

It seems to me that the outputting of numbers with iostream is the worst part of C++ (and it&#039;s not even part of C++!) The thing that really bugs me is the persistance of things like floatfield and the non-persistance of the width settings. It means that for any given output statement you&#039;ve no idea what will be displayed unless you explicitly set everything. For example, setting output to scientific somewhere in your program means that all subsequent output will be scientific unless you explicitly say otherwise - the only way I can see to get back to the default output is to use

	std::cout.unsetf(std::ios::scientific&#124;std::ios::showpoint&#124;std::ios::fixed);


Bring on C# (or use stdio) I say.

Anyway enough of that, there are a few typos on this page:

In the description of the floatfield group, &quot;floatfield&quot; is missing for showpoint.
In the floating point output examples table, for &quot;fixed&quot; precision 3 there are two decimal points, and for &quot;scientific&quot; precisions 4-6 there are no decimal points.

VS 2005 seems to have a bug regarding showpoint manipulator. The following code:


	double x = 1.2345;
	cout &lt;&lt; showpoint &lt;&lt; x &lt;&lt; endl;
	cout &lt;&lt; scientific &lt;&lt; x &lt;&lt; endl;
	cout &lt;&lt; showpoint &lt;&lt; x &lt;&lt; endl;
	cout.setf(std::ios::showpoint,std::ios::floatfield);
	cout &lt;&lt; x &lt;&lt; endl;


produces:

1.23450
1.234500e+000
1.234500e+000
1.23450

so you need to use setf to switch from scientific to showpoint (not that I can imagine that will worry too many people!)</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>It seems to me that the outputting of numbers with iostream is the worst part of C++ (and it&#8217;s not even part of C++!) The thing that really bugs me is the persistance of things like floatfield and the non-persistance of the width settings. It means that for any given output statement you&#8217;ve no idea what will be displayed unless you explicitly set everything. For example, setting output to scientific somewhere in your program means that all subsequent output will be scientific unless you explicitly say otherwise &#8211; the only way I can see to get back to the default output is to use</p>
<p>	std::cout.unsetf(std::ios::scientific|std::ios::showpoint|std::ios::fixed);</p>
<p>Bring on C# (or use stdio) I say.</p>
<p>Anyway enough of that, there are a few typos on this page:</p>
<p>In the description of the floatfield group, &#8220;floatfield&#8221; is missing for showpoint.<br />
In the floating point output examples table, for &#8220;fixed&#8221; precision 3 there are two decimal points, and for &#8220;scientific&#8221; precisions 4-6 there are no decimal points.</p>
<p>VS 2005 seems to have a bug regarding showpoint manipulator. The following code:</p>
<p>	double x = 1.2345;<br />
	cout &lt;&lt; showpoint &lt;&lt; x &lt;&lt; endl;<br />
	cout &lt;&lt; scientific &lt;&lt; x &lt;&lt; endl;<br />
	cout &lt;&lt; showpoint &lt;&lt; x &lt;&lt; endl;<br />
	cout.setf(std::ios::showpoint,std::ios::floatfield);<br />
	cout &lt;&lt; x &lt;&lt; endl;</p>
<p>produces:</p>
<p>1.23450<br />
1.234500e+000<br />
1.234500e+000<br />
1.23450</p>
<p>so you need to use setf to switch from scientific to showpoint (not that I can imagine that will worry too many people!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 13.2 &#8212; Input with istream</title>
		<link>http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/comment-page-1/#comment-24942</link>
		<dc:creator>Learn C++ - &#187; 13.2 &#8212; Input with istream</dc:creator>
		<pubDate>Tue, 26 Aug 2008 03:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/133-output-with-ostream-and-ios/#comment-24942</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 13.1 &#8212; Input and output (I/O) streams &#124; Home &#124; 13.3 &#8212; Output with ostream and ios &#187;     Tuesday, March 4th, 2008 at 4:09 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 13.1 &#8212; Input and output (I/O) streams | Home | 13.3 &#8212; Output with ostream and ios &raquo;     Tuesday, March 4th, 2008 at 4:09 [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

