slide029.html

来自「《Big C++ 》Third Edition电子书和代码全集-Part1」· HTML 代码 · 共 52 行

HTML
52
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<meta content="blendTrans(Duration=2)" http-equiv="Page-Enter">
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<meta name='Copyright' content='2005 John Wiley & Sons'>
	<meta name='Author' content='Kurt Schmidt'>
	<script language="JavaScript" src="./config.js"></script>
	<script language="JavaScript" src="./pageFormat.js"></script>
	<script><!-- // Set title on page
		title()
	//--></script>
</head>


<body>
<div onclick="document.location='slide030.html'">
<h2><font color="#009999">17.5.1 Stream Output &lt;&lt;</font></h2>
<font size="+1">

<ul>
	<li>Output stream class (chptr. 12) provides ability to write a single
		character</li>
	<li>Stream library provides insertion operator for all built-in types:
		<blockquote><tt>
			ostream&amp; operator&lt;&lt;(ostream&amp; out, double value);
		</tt></blockquote>
		<p><b>Note:</b> the stream itself is returned</p>
	</li>
	<li><b>E.g.:</b>  Overload output for <tt>Fraction</tt>
		<blockquote><tt>
<pre>ostream&amp; operator&lt;&lt;( ostream &amp;out, const Fraction &amp;value )
{
   out &lt;&lt; value.numerator() &lt;&lt; "/" &lt;&lt; value.denominator();
   return out;
}</pre>
		</tt></blockquote>
	</li>
</ul>

</font>

<hr>
<center><small>
	<a href='slide028.html'>prev</a>
	|<a href='slide001.html'>top</a>
	|<a href='slide030.html'>next</a>
</small></center>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?