亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch03.htm

?? good book for learning c++ standard language
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<!-- This document was created from RTF source by rtftohtml version 3.0.1 -->

	<META NAME="GENERATOR" Content="Symantec Visual Page 1.0">
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
	<TITLE>Teach Yourself C++ in 21 Days</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<H1 ALIGN="CENTER"><A HREF="ch02.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/htm/ch02.htm"><IMG SRC="../buttons/BLANPREV.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANPREV.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="javascript:if(confirm('http://www.mcp.com/sams  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.mcp.com/sams'" tppabs="http://www.mcp.com/sams"><IMG
SRC="../buttons/BLANHOME.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANHOME.GIF" WIDTH="37" HEIGHT="37" ALIGN="BOTTOM"
BORDER="0"></A><A HREF="../index.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/index.htm"><IMG SRC="../buttons/BLANTOC.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANTOC.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="ch04.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/htm/ch04.htm"><IMG SRC="../buttons/BLANNEXT.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANNEXT.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A></H1>
<H1></H1>

<UL>
	<LI><A HREF="#Heading1">Day 3</A>
	<UL>
		<LI><A HREF="#Heading2">Variables and Constants</A>
		<UL>
			<LI><A HREF="#Heading3">What Is a Variable?</A>
			<UL>
				<LI><A HREF="#Heading4">Figure 3.1.</A>
			</UL>
			<LI><A HREF="#Heading5">Setting Aside Memory</A>
			<UL>
				<LI><A HREF="#Heading6">Size of Integers</A>
			</UL>
			<LI><A HREF="#Heading7">Listing 3.1. Determining the size of variable types</A>
			<LI><A HREF="#Heading8">on your computer.</A>
			<UL>
				<LI><A HREF="#Heading9">signed and unsigned</A>
				<LI><A HREF="#Heading10">Fundamental Variable Types</A>
			</UL>
			<LI><A HREF="#Heading11">Defining a Variable</A>
			<UL>
				<LI><A HREF="#Heading12">Case Sensitivity</A>
				<LI><A HREF="#Heading13">Keywords</A>
			</UL>
			<LI><A HREF="#Heading14">Creating More Than One Variable at a Time</A>
			<LI><A HREF="#Heading16">Assigning Values to Your Variables</A>
			<LI><A HREF="#Heading17">Listing 3.2. A demonstration of the use of variables</A><A
			HREF="#Heading18">.</A>
			<LI><A HREF="#Heading19">typedef</A>
			<LI><A HREF="#Heading20">Listing 3.3. A demonstration of typedef</A><A HREF="#Heading21">.</A>
			<LI><A HREF="#Heading22">When to Use short and When to Use long</A>
			<UL>
				<LI><A HREF="#Heading23">Wrapping Around an unsigned Integer</A>
			</UL>
			<LI><A HREF="#Heading24">Listing 3.4.</A>
			<LI><A HREF="#Heading25">A demonstration of putting too large a value in an unsigned
			integer.</A>
			<UL>
				<LI><A HREF="#Heading26">Wrapping Around a signed Integer</A>
			</UL>
			<LI><A HREF="#Heading27">Listing 3.5.</A>
			<LI><A HREF="#Heading28">A demonstration of adding too large a number to a signed
			integer.</A>
			<LI><A HREF="#Heading29">Characters</A>
			<UL>
				<LI><A HREF="#Heading30">Characters and Numbers</A>
			</UL>
			<LI><A HREF="#Heading31">Listing 3.6. Printing characters based on numbers</A><A
			HREF="#Heading32">.</A>
			<UL>
				<LI><A HREF="#Heading33">Special Printing Characters</A>
			</UL>
			<LI><A HREF="#Heading34">Constants</A>
			<UL>
				<LI><A HREF="#Heading35">Literal Constants</A>
				<LI><A HREF="#Heading36">Symbolic Constants</A>
			</UL>
			<LI><A HREF="#Heading37">Enumerated Constants</A>
			<LI><A HREF="#Heading38">Listing 3.7. A demonstration of enumerated constants</A>
			<LI><A HREF="#Heading39">.</A>
			<LI><A HREF="#Heading40">Summary</A>
			<LI><A HREF="#Heading41">Q&amp;A</A>
			<LI><A HREF="#Heading42">Workshop</A>
			<UL>
				<LI><A HREF="#Heading43">Quiz</A>
				<LI><A HREF="#Heading44">Exercises</A>
			</UL>
		</UL>
	</UL>
</UL>

<P>
<HR SIZE="4">

<H2 ALIGN="CENTER"><A NAME="Heading1"></A><FONT COLOR="#000077">Day 3</FONT></H2>
<H2 ALIGN="CENTER"><A NAME="Heading2"></A><FONT COLOR="#000077">Variables and Constants</FONT></H2>
<P>Programs need a way to store the data they use. Variables and constants offer
various ways to represent and manipulate that data.</P>
<P>Today you will learn

<UL>
	<LI>How to declare and define variables and constants.
	<P>
	<LI>How to assign values to variables and manipulate those values.
	<P>
	<LI>How to write the value of a variable to the screen.
</UL>

<H3 ALIGN="CENTER"><A NAME="Heading3"></A><FONT COLOR="#000077">What Is a Variable?</FONT></H3>
<P>In C++ a variable is a place to store information. A variable is a location in
your computer's memory in which you can store a value and from which you can later
retrieve that value.</P>
<P>Your computer's memory can be viewed as a series of cubbyholes. Each cubbyhole
is one of many, many such holes all lined up. Each cubbyhole--or memory location--is
numbered sequentially. These numbers are known as memory addresses. A variable reserves
one or more cubbyholes in which you may store a value.</P>
<P>Your variable's name (for example, <TT>myVariable</TT>) is a label on one of these
cubbyholes, so that you can find it easily without knowing its actual memory address.
Figure 3.1 is a schematic representation of this idea. As you can see from the figure,
<TT>myVariable</TT> starts at memory address <TT>103</TT>. Depending on the size
of <TT>myVariable</TT>, it can take up one or more memory addresses.<BR>
<BR>
<A NAME="Heading4"></A><A HREF="javascript:if(confirm('http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/art/ch03/032cp01.jpg  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?'))window.location='http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/art/ch03/032cp01.jpg'" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/art/ch03/032cp01.jpg"><FONT COLOR="#000077">Figure
3.1.</FONT></A><FONT COLOR="#000077"> </FONT><I>A schematic representation of memory.</I>


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>RAM is random access memory. When
	you run your program, it is loaded into RAM from the disk file. All variables are
	also created in RAM. When programmers talk of memory, it is usually RAM to which
	they are referring. 
<HR>


</BLOCKQUOTE>

<H4 ALIGN="CENTER"><A NAME="Heading5"></A><FONT COLOR="#000077">Setting Aside Memory</FONT></H4>
<P>When you define a variable in C++, you must tell the compiler what kind of variable
it is: an integer, a character, and so forth. This information tells the compiler
how much room to set aside and what kind of value you want to store in your variable.</P>
<P>Each cubbyhole is one byte large. If the type of variable you create is two bytes
in size, it needs two bytes of memory, or two cubbyholes. The type of the variable
(for example, integer) tells the compiler how much memory (how many cubbyholes) to
set aside for the variable.</P>
<P>Because computers use bits and bytes to represent values, and because memory is
measured in bytes, it is important that you understand and are comfortable with these
concepts. For a full review of this topic, please read Appendix B, &quot;C++ Keywords.&quot;
<H4 ALIGN="CENTER"><A NAME="Heading6"></A><FONT COLOR="#000077">Size of Integers</FONT></H4>
<P>On any one computer, each variable type takes up a single, unchanging amount of
room. That is, an integer might be two bytes on one machine, and four on another,
but on either computer it is always the same, day in and day out.</P>
<P>A <TT>char</TT> variable (used to hold characters) is most often one byte long.
A <TT>short</TT> integer is two bytes on most computers, a <TT>long</TT> integer
is usually four bytes, and an integer (without the keyword <TT>short</TT> or <TT>long</TT>)
can be two or four bytes. Listing 3.1 should help you determine the exact size of
these types on your computer.</P>

<DL>
	<DD>
<HR>
<FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>A <I>character</I> is a single
	letter, number, or symbol that takes up one byte of memory. 
<HR>

</DL>

<P><A NAME="Heading7"></A><FONT SIZE="4" COLOR="#000077"><B>Listing 3.1. Determining
the size of variable types on your computer.</B></FONT></P>
<PRE><FONT COLOR="#0066FF">1:   #include &lt;iostream.h&gt;
2:
3:   int main()
4:   {
5:     cout &lt;&lt; &quot;The size of an int is:\t\t&quot;    &lt;&lt; sizeof(int)    &lt;&lt; &quot; bytes.\n&quot;;
6:     cout &lt;&lt; &quot;The size of a short int is:\t&quot; &lt;&lt; sizeof(short)  &lt;&lt; &quot; bytes.\n&quot;;
7:     cout &lt;&lt; &quot;The size of a long int is:\t&quot;  &lt;&lt; sizeof(long)   &lt;&lt; &quot; bytes.\n&quot;;
8:     cout &lt;&lt; &quot;The size of a char is:\t\t&quot;    &lt;&lt; sizeof(char)   &lt;&lt; &quot; bytes.\n&quot;;
9:     cout &lt;&lt; &quot;The size of a float is:\t\t&quot;   &lt;&lt; sizeof(float)  &lt;&lt; &quot; bytes.\n&quot;;
10:    cout &lt;&lt; &quot;The size of a double is:\t&quot;    &lt;&lt; sizeof(double) &lt;&lt; &quot; bytes.\n&quot;;
11:
12:        return 0;
<TT>13: }</TT>
Output: The size of an int is:          2 bytes.
The size of a short int is:     2 bytes.
The size of a long int is:      4 bytes.
The size of a char is:          1 bytes.
The size of a float is:         4 bytes.
The size of a double is:        8 bytes.
</FONT></PRE>


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>On your computer, the number of
	bytes presented might be different. 
<HR>


</BLOCKQUOTE>


<DL>
	<DD>
<HR>
<FONT COLOR="#000077"><B>Analysis:</B></FONT><B> </B>Most of Listing 3.1 should be
	pretty familiar. The one new feature is the use of the <TT>sizeof()</TT> function
	in lines 5 through 10. <TT>sizeof()</TT> is provided by your compiler, and it tells
	you the size of the object you pass in as a parameter. For example, on line 5 the
	keyword <TT>int</TT> is passed into <TT>sizeof()</TT>. Using <TT>sizeof()</TT>, I
	was able to determine that on my computer an <TT>int</TT> is equal to a <TT>short</TT>
	<TT>int</TT>, which is 2 bytes. 
<HR>

</DL>

<H4 ALIGN="CENTER"><A NAME="Heading9"></A><FONT COLOR="#000077">signed and unsigned</FONT></H4>
<P>In addition, all integer types come in two varieties: <TT>signed</TT> and <TT>unsigned</TT>.
The idea here is that sometimes you need negative numbers, and sometimes you don't.
Integers (<TT>short</TT> and <TT>long</TT>) without the word &quot;unsigned&quot;
are assumed to be <TT>signed</TT>. <TT>Signed</TT> integers are either negative or
positive. <TT>Unsigned</TT> integers are always positive.</P>
<P>Because you have the same number of bytes for both <TT>signed</TT> and <TT>unsigned</TT>
integers, the largest number you can store in an <TT>unsigned</TT> integer is twice
as big as the largest positive number you can store in a <TT>signed</TT> integer.
An <TT>unsigned</TT> <TT>short</TT> integer can handle numbers from 0 to 65,535.
Half the numbers represented by a <TT>signed</TT> <TT>short</TT> are negative, thus
a <TT>signed</TT> <TT>short</TT> can only represent numbers from -32,768 to 32,767.
If this is confusing, be sure to read Appendix A, &quot;Operator Precedence.&quot;
<H4 ALIGN="CENTER"><A NAME="Heading10"></A><FONT COLOR="#000077">Fundamental Variable
Types</FONT></H4>
<P>Several other variable types are built into C++. They can be conveniently divided
into integer variables (the type discussed so far), floating-point variables, and
character variables.</P>
<P>Floating-point variables have values that can be expressed as fractions--that
is, they are real numbers. Character variables hold a single byte and are used for
holding the 256 characters and symbols of the ASCII and extended ASCII character
sets.</P>

<DL>
	<DD>
<HR>
<FONT COLOR="#000077"><B>New Term: </B></FONT><I>The ASCII character set</I> is the
	set of characters standardized for use on computers. ASCII is an acronym for American
	Standard Code for Information Interchange. Nearly every computer operating system
	supports ASCII, though many support other international character sets as well. 
<HR>

</DL>

<P>The types of variables used in C++ programs are described in Table 3.1. This table
shows the variable type, how much room this book assumes it takes in memory, and
what kinds of values can be stored in these variables. The values that can be stored
are determined by the size of the variable types, so check your output from Listing
3.1. <BR>
<BR>
<FONT SIZE="4"><B>Table 3.1. Variable Types. </B></FONT>
<TABLE BORDER="0">
	<TR ALIGN="LEFT" rowspan="1">
		<TD WIDTH="139" ALIGN="LEFT"><B><I>Type</I></B></TD>
		<TD WIDTH="67" ALIGN="LEFT"><B><I>Size</I></B></TD>
		<TD ALIGN="LEFT"><B><I>Values</I></B></TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD WIDTH="139" ALIGN="LEFT"><TT>unsigned short int</TT></TD>
		<TD WIDTH="67" ALIGN="LEFT">2 bytes</TD>
		<TD ALIGN="LEFT">0 to 65,535</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD WIDTH="139" ALIGN="LEFT"><TT>short int</TT></TD>
		<TD WIDTH="67" ALIGN="LEFT">2 bytes</TD>
		<TD ALIGN="LEFT">-32,768 to 32,767</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD WIDTH="139" ALIGN="LEFT"><TT>unsigned long int</TT></TD>
		<TD WIDTH="67" ALIGN="LEFT">4 bytes</TD>
		<TD ALIGN="LEFT">0 to 4,294,967,295</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD WIDTH="139" ALIGN="LEFT"><TT>long int</TT></TD>
		<TD WIDTH="67" ALIGN="LEFT">4 bytes</TD>
		<TD ALIGN="LEFT">-2,147,483,648 to 2,147,483,647</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲自拍与偷拍| 久久日韩粉嫩一区二区三区 | 日韩欧美国产麻豆| 欧美自拍偷拍一区| 欧美性猛交xxxx乱大交退制版| 99九九99九九九视频精品| 成人avav在线| 色94色欧美sute亚洲13| 欧美日韩在线综合| 制服丝袜亚洲精品中文字幕| 欧美一区二区国产| 久久久久久久久久久久久女国产乱| 国产日韩欧美a| 亚洲码国产岛国毛片在线| 亚洲一区二区在线免费看| 男女视频一区二区| 盗摄精品av一区二区三区| av不卡免费电影| 欧美日韩电影在线播放| 欧美成人精精品一区二区频| 中文字幕精品—区二区四季| 中文字幕亚洲区| 丝袜美腿成人在线| 国产精品1区2区| 在线观看国产一区二区| 欧美白人最猛性xxxxx69交| 国产精品青草综合久久久久99| 一区二区成人在线| 国产综合久久久久久鬼色| 97久久人人超碰| 日韩欧美一级在线播放| 中文字幕在线免费不卡| 老司机免费视频一区二区三区| 国产九色sp调教91| 欧美视频你懂的| 国产欧美日韩综合精品一区二区| 一区二区三区丝袜| 国产高清不卡二三区| 欧美男人的天堂一二区| 国产精品人人做人人爽人人添| 午夜精品福利一区二区三区蜜桃| 国产精品一二三区| 欧美一二三区精品| 亚洲美女少妇撒尿| 成人一区二区三区视频在线观看| 欧洲av在线精品| 国产精品福利一区| 精品一二线国产| 精品污污网站免费看| 国产欧美日韩精品在线| 麻豆精品在线看| 欧美在线观看一区| 国产精品久久久久久久久久免费看| 天天色图综合网| 色婷婷精品久久二区二区蜜臀av | 中文字幕一区二区三区色视频| 日韩专区欧美专区| 91麻豆福利精品推荐| 中文幕一区二区三区久久蜜桃| 精品中文字幕一区二区小辣椒 | 婷婷国产v国产偷v亚洲高清| 色综合久久中文字幕综合网| 国产精品网站在线| 岛国精品一区二区| 国产精品色在线观看| 激情文学综合丁香| 日韩三级av在线播放| 日韩av一区二| 日韩亚洲欧美在线观看| 日韩电影在线观看电影| 在线成人小视频| 日韩极品在线观看| 91精品国产综合久久香蕉的特点 | 色综合天天综合网天天看片| 亚洲欧洲精品一区二区三区| 国产成人免费视频| 亚洲国产高清aⅴ视频| 国产成人精品一区二| 国产精品丝袜在线| 日本道精品一区二区三区| 亚洲激情校园春色| 欧美麻豆精品久久久久久| 日韩精品一区第一页| 日韩欧美区一区二| 国产麻豆视频精品| 国产精品视频看| 欧美性极品少妇| 美女网站视频久久| 久久亚洲精精品中文字幕早川悠里| 国产精品一级片| 亚洲视频1区2区| 欧美日韩不卡在线| 国内精品在线播放| 亚洲女与黑人做爰| 欧美大肚乱孕交hd孕妇| 国产成人av电影免费在线观看| 亚洲欧洲一区二区三区| 欧美日韩一级二级| 国产一区二区三区四区五区入口 | 日韩电影免费一区| 久久久久久久综合| 色婷婷久久久久swag精品| 日产精品久久久久久久性色| 国产性做久久久久久| 欧美在线视频不卡| 国产精品香蕉一区二区三区| 亚洲一区二区视频| 精品国产免费视频| 91免费国产在线观看| 天堂av在线一区| 国产精品三级av| 日韩精品一区二区三区视频播放| 国产成人午夜电影网| 日韩激情一二三区| 国产精品毛片a∨一区二区三区| 欧美日韩黄色影视| 国产99久久精品| 久久黄色级2电影| 亚洲网友自拍偷拍| 欧美激情中文字幕| 欧美一区二区免费观在线| 日本高清不卡在线观看| 高清国产一区二区| 美女一区二区视频| 亚洲国产cao| 亚洲欧美日韩久久| 国产日本欧洲亚洲| 精品乱码亚洲一区二区不卡| 欧美亚洲动漫制服丝袜| av电影天堂一区二区在线 | 色妹子一区二区| 国产风韵犹存在线视精品| 美女脱光内衣内裤视频久久影院| 一区二区成人在线| 亚洲色图视频免费播放| 欧美国产日本视频| 久久婷婷国产综合国色天香 | 国产日产精品一区| 久久久久国产精品麻豆ai换脸 | 国产精品乱码一区二区三区软件 | 亚洲欧洲成人精品av97| 欧美国产激情二区三区 | voyeur盗摄精品| 不卡的电视剧免费网站有什么| 国产资源在线一区| 精品一区中文字幕| 国产一区二区在线看| 国产米奇在线777精品观看| 久久91精品久久久久久秒播| 日日摸夜夜添夜夜添亚洲女人| 五月天久久比比资源色| 亚洲电影一级片| 日本在线播放一区二区三区| 图片区小说区国产精品视频| 亚洲aⅴ怡春院| 美女脱光内衣内裤视频久久影院| 美女在线观看视频一区二区| 另类欧美日韩国产在线| 国产精品一二三四区| 国产成人av一区二区三区在线| 国产经典欧美精品| 成人一区二区视频| 91理论电影在线观看| 欧美色综合网站| 欧美一区三区四区| 国产亚洲精品资源在线26u| 国产精品三级av在线播放| 亚洲男人的天堂一区二区| 午夜亚洲国产au精品一区二区| 视频一区二区国产| 国产一区二区三区免费| jvid福利写真一区二区三区| 欧美午夜宅男影院| 精品国产三级电影在线观看| 国产精品久久久久久久午夜片| 综合久久久久久| 日本人妖一区二区| 成人av资源在线观看| 欧美三级乱人伦电影| 欧美电影免费观看高清完整版在 | 精品国产伦一区二区三区观看方式 | 97精品国产97久久久久久久久久久久| 成人av影视在线观看| 欧美日韩中文字幕精品| 久久久99精品久久| 亚洲线精品一区二区三区| 激情都市一区二区| 日本韩国一区二区| 久久久久久久av麻豆果冻| 亚洲伊人伊色伊影伊综合网| 国产一区二区三区观看| 欧美在线高清视频| 国产网红主播福利一区二区| 亚洲一区在线看| 国产不卡一区视频| 91精品国产高清一区二区三区 | 亚洲国产精品传媒在线观看| 天天综合色天天| 91丨porny丨在线| 国产午夜一区二区三区|