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

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

?? ch01.htm

?? good book for learning c++ standard language
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
	presses a button or chooses from a menu--and the program must respond. Programs are
	becoming increasingly interactive, and it has became important to design for that
	kind of functionality. 
<HR>

</DL>

<P>Old-fashioned programs forced the user to proceed step-by-step through a series
of screens. Modern event-driven programs present all the choices at once and respond
to the user's actions.</P>
<P>Object-oriented programming attempts to respond to these needs, providing techniques
for managing enormous complexity, achieving reuse of software components, and coupling
data with the tasks that manipulate that data.</P>
<P>The essence of object-oriented programming is to treat data and the procedures
that act upon the data as a single &quot;object&quot;--a self-contained entity with
an identity and certain characteristics of its own.
<H4 ALIGN="CENTER"><A NAME="Heading8"></A><FONT COLOR="#000077">C++ and Object-Oriented
Programming</FONT></H4>
<P>C++ fully supports object-oriented programming, including the four pillars of
object-oriented development: encapsulation, data hiding, inheritance, and polymorphism.
Encapsulation and Data Hiding When an engineer needs to add a resistor to the device
she is creating, she doesn't typically build a new one from scratch. She walks over
to a bin of resistors, examines the colored bands that indicate the properties, and
picks the one she needs. The resistor is a &quot;black box&quot; as far as the engineer
is concerned--she doesn't much care how it does its work as long as it conforms to
her specifications; she doesn't need to look inside the box to use it in her design.</P>
<P>The property of being a self-contained unit is called encapsulation. With encapsulation,
we can accomplish data hiding. Data hiding is the highly valued characteristic that
an object can be used without the user knowing or caring how it works internally.
Just as you can use a refrigerator without knowing how the compressor works, you
can use a well-designed object without knowing about its internal data members.</P>
<P>Similarly, when the engineer uses the resistor, she need not know anything about
the internal state of the resistor. All the properties of the resistor are encapsulated
in the resistor object; they are not spread out through the circuitry. It is not
necessary to understand how the resistor works in order to use it effectively. Its
data is hidden inside the resistor's casing.</P>
<P>C++ supports the properties of encapsulation and data hiding through the creation
of user-defined types, called classes. You'll see how to create classes on Day 6,
&quot;Basic Classes.&quot; Once created, a well-defined class acts as a fully encapsulated
entity--it is used as a whole unit. The actual inner workings of the class should
be hidden. Users of a well-defined class do not need to know how the class works;
they just need to know how to use it. Inheritance and Reuse When the engineers at
Acme Motors want to build a new car, they have two choices: They can start from scratch,
or they can modify an existing model. Perhaps their Star model is nearly perfect,
but they'd like to add a turbocharger and a six-speed transmission. The chief engineer
would prefer not to start from the ground up, but rather to say, &quot;Let's build
another Star, but let's add these additional capabilities. We'll call the new model
a Quasar.&quot; A Quasar is a kind of Star, but one with new features.</P>
<P>C++ supports the idea of reuse through inheritance. A new type, which is an extension
of an existing type, can be declared. This new subclass is said to derive from the
existing type and is sometimes called a derived type. The Quasar is derived from
the Star and thus inherits all its qualities, but can add to them as needed. Inheritance
and its application in C++ are discussed on Day 12, &quot;Inheritance,&quot; and
Day 15, &quot;Advanced Inheritance.&quot; Polymorphism The new Quasar might respond
differently than a Star does when you press down on the accelerator. The Quasar might
engage fuel injection and a turbocharger, while the Star would simply let gasoline
into its carburetor. A user, however, does not have to know about these differences.
He can just &quot;floor it,&quot; and the right thing will happen, depending on which
car he's driving.</P>
<P>C++ supports the idea that different objects do &quot;the right thing&quot; through
what is called function polymorphism and class polymorphism. Poly means many, and
morph means form. Polymorphism refers to the same name taking many forms, and is
discussed on Day 10, &quot;Advanced Functions,&quot; and Day 13, &quot;Polymorphism.&quot;
<H3 ALIGN="CENTER"><A NAME="Heading9"></A><FONT COLOR="#000077">How C++ Evolved</FONT></H3>
<P>As object-oriented analysis, design, and programming began to catch on, Bjarne
Stroustrup took the most popular language for commercial software development, C,
and extended it to provide the features needed to facilitate object-oriented programming.
He created C++, and in less than a decade it has gone from being used by only a handful
of developers at AT&amp;T to being the programming language of choice for an estimated
one million developers worldwide. It is expected that by the end of the decade, C++
will be the predominant language for commercial software development.</P>
<P>While it is true that C++ is a superset of C, and that virtually any legal C program
is a legal C++ program, the leap from C to C++ is very significant. C++ benefited
from its relationship to C for many years, as C programmers could ease into their
use of C++. To really get the full benefit of C++, however, many programmers found
they had to unlearn much of what they knew and learn a whole new way of conceptualizing
and solving programming problems.
<H3 ALIGN="CENTER"><A NAME="Heading10"></A><FONT COLOR="#000077">The ANSI Standard</FONT></H3>
<P>The Accredited Standards Committee, operating under the procedures of the American
National Standards Institute (ANSI), is working to create an international standard
for C++.</P>
<P>The draft of this standard has been published, and a link is available at <TT>www.libertyassociates.com</TT>.</P>
<P>The ANSI standard is an attempt to ensure that C++ is portable--that code you
write for Microsoft's compiler will compile without errors, using a compiler from
any other vendor. Further, because the code in this book is ANSI compliant, it should
compile without errors on a Mac, a Windows box, or an Alpha.</P>
<P>For most students of C++, the ANSI standard will be invisible. The standard has
been stable for a while, and all the major manufacturers support the ANSI standard.
We have endeavored to ensure that all the code in this edition of this book is ANSI
compliant.
<H3 ALIGN="CENTER"><A NAME="Heading11"></A><FONT COLOR="#000077">Should I Learn C
First?</FONT></H3>
<P>The question inevitably arises: &quot;Since C++ is a superset of C, should I learn
C first?&quot; Stroustrup and most other C++ programmers agree. Not only is it unnecessary
to learn C first, it may be advantageous not to do so. This book attempts to meet
the needs of people like you, who come to C++ without prior experience of C. In fact,
this book assumes no programming experience of any kind.
<H3 ALIGN="CENTER"><A NAME="Heading12"></A><FONT COLOR="#000077">Preparing to Program</FONT></H3>
<P>C++, perhaps more than other languages, demands that the programmer design the
program before writing it. Trivial problems, such as the ones discussed in the first
few chapters of this book, don't require much design. Complex problems, however,
such as the ones professional programmers are challenged with every day, do require
design, and the more thorough the design, the more likely it is that the program
will solve the problems it is designed to solve, on time and on budget. A good design
also makes for a program that is relatively bug-free and easy to maintain. It has
been estimated that fully 90 percent of the cost of software is the combined cost
of debugging and maintenance. To the extent that good design can reduce those costs,
it can have a significant impact on the bottom-line cost of the project.</P>
<P>The first question you need to ask when preparing to design any program is, &quot;What
is the problem I'm trying to solve?&quot; Every program should have a clear, well-articulated
goal, and you'll find that even the simplest programs in this book do so.</P>
<P>The second question every good programmer asks is, &quot;Can this be accomplished
without resorting to writing custom software?&quot; Reusing an old program, using
pen and paper, or buying software off the shelf is often a better solution to a problem
than writing something new. The programmer who can offer these alternatives will
never suffer from lack of work; finding less-expensive solutions to today's problems
will always generate new opportunities later.</P>
<P>Assuming you understand the problem, and it requires writing a new program, you
are ready to begin your design.
<H3 ALIGN="CENTER"><A NAME="Heading13"></A><FONT COLOR="#000077">Your Development
Environment</FONT></H3>
<P>This book makes the assumption that your computer has a mode in which you can
write directly to the screen, without worrying about a graphical environment, such
as the ones in Windows or on the Macintosh.</P>
<P>Your compiler may have its own built-in text editor, or you may be using a commercial
text editor or word processor that can produce text files. The important thing is
that whatever you write your program in, it must save simple, plain-text files, with
no word processing commands embedded in the text. Examples of safe editors include
Windows Notepad, the DOS Edit command, Brief, Epsilon, EMACS, and vi. Many commercial
word processors, such as WordPerfect, Word, and dozens of others, also offer a method
for saving simple text files.</P>
<P>The files you create with your editor are called source files, and for C++ they
typically are named with the extension <TT>.CPP</TT>, <TT>.CP</TT>, or <TT>.C</TT>.
In this book, we'll name all the source code files with the <TT>.CPP</TT> extension,
but check your compiler for what it needs.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>Most C++ compilers don't care what
	extension you give your source code, but if you don't specify otherwise, many will
	use <TT>.CPP</TT> by default.</P>
	<P>DO use a simple text editor to create your source code, or use the built-in editor
	that comes with your compiler. DON'T use a word processor that saves special formatting
	characters. If you do use a word processor, save the file as ASCII text. DO save
	your files with the <TT>.C</TT>, <TT>.CP</TT>, or <TT>.CPP</TT> extension. DO check
	your documentation for specifics about your compiler and linker to ensure that you
	know how to compile and link your programs. 
<HR>


</BLOCKQUOTE>

<H3 ALIGN="CENTER"><A NAME="Heading14"></A><FONT COLOR="#000077">Compiling the Source
Code</FONT></H3>
<P>Although the source code in your file is somewhat cryptic, and anyone who doesn't
know C++ will struggle to understand what it is for, it is still in what we call
human-readable form. Your source code file is not a program, and it can't be executed,
or run, as a program can.</P>
<P>To turn your source code into a program, you use a compiler. How you invoke your
compiler, and how you tell it where to find your source code, will vary from compiler
to compiler; check your documentation. In Borland's Turbo C++ you pick the <TT>RUN</TT>
menu command or type</P>
<PRE><FONT COLOR="#0066FF">tc &lt;filename&gt;
</FONT></PRE>
<P>from the command line, where <TT>&lt;</TT>filename<TT>&gt;</TT> is the name of
your source code file (for example, <TT>test.cpp</TT>). Other compilers may do things
slightly differently.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>If you compile the source code from
	the operating system's command line, you should type the following:

	<BLOCKQUOTE>
		<P>For the Borland C++ compiler: <FONT COLOR="#0066FF"><TT>bcc</TT> &lt;filename&gt;</FONT><BR>
		<BR>
		For the Borland C++ for Windows compiler: <FONT COLOR="#0066FF"><TT>bcc</TT> &lt;filename&gt;
		</FONT><BR>
		<BR>
		For the Borland Turbo C++ <FONT COLOR="#0066FF">compiler: <TT>tc</TT> &lt;filename&gt;
		</FONT><BR>
		<BR>
		For the Microsoft compilers: <FONT COLOR="#0066FF"><TT>cl</TT> &lt;filename&gt;</FONT>

	</BLOCKQUOTE>
	<P>
<HR>


</BLOCKQUOTE>

<P>After your source code is compiled, an object file is produced. This file is often
named with the extension <TT>.OBJ</TT>. This is still not an executable program,
however. To turn this into an executable program, you must run your linker.
<H3 ALIGN="CENTER"><A NAME="Heading15"></A><FONT COLOR="#000077">Creating an Executable
File with the Linker</FONT></H3>
<H3 ALIGN="CENTER"><FONT COLOR="#000077"></FONT></H3>
<P>C++ programs are typically created by linking together one or more OBJ files with
one or more libraries. A library is a collection of linkable files that were supplied
with your compiler, that you purchased separately, or that you created and compiled.
All C++ compilers come with a library of useful functions (or procedures) and classes
that you can include in your program. A function is a block of code that performs
a service, such as adding two numbers or printing to the screen. A class is a collection
of data and related functions; we'll be talking about classes a lot, starting on
Day 5, &quot;Functions.&quot;</P>
<P>The steps to create an executable file are

<DL>
	<DD><B>1.</B> Create a source code file, with a <TT>.CPP</TT> extension.<BR>
	<B><BR>
	2.</B> Compile the source code into a file with the <TT>.OBJ</TT> extension.<BR>
	<B><BR>
	3.</B> Link your OBJ file with any needed libraries to produce an executable program.
</DL>

<H3 ALIGN="CENTER"><A NAME="Heading17"></A><FONT COLOR="#000077">The Development

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91国内精品野花午夜精品| 精品av综合导航| 欧美成人精品福利| 亚洲男人天堂一区| 国产乱子轮精品视频| 欧美私模裸体表演在线观看| 欧美国产禁国产网站cc| 蜜桃视频在线观看一区| 色狠狠av一区二区三区| 国产精品理伦片| 久久国产夜色精品鲁鲁99| 欧美天堂一区二区三区| 亚洲丝袜另类动漫二区| 丁香桃色午夜亚洲一区二区三区| 欧美人体做爰大胆视频| 亚洲激情图片小说视频| 99久久久国产精品| 国产精品私房写真福利视频| 国内精品国产成人| 精品国偷自产国产一区| 男女激情视频一区| 精品视频全国免费看| 一区二区三区小说| 99久久久精品免费观看国产蜜| 国产色91在线| 国产尤物一区二区| 337p粉嫩大胆噜噜噜噜噜91av| 石原莉奈在线亚洲三区| 欧美视频一区在线观看| 亚洲综合在线免费观看| 色综合咪咪久久| 亚洲精品乱码久久久久久久久| 色综合激情五月| 成人欧美一区二区三区小说| jizzjizzjizz欧美| 国产精品传媒在线| 色国产精品一区在线观看| 亚洲天堂精品视频| 欧美综合久久久| 亚洲mv大片欧洲mv大片精品| 欧美一区二区三区日韩| 美国一区二区三区在线播放| 精品久久久网站| 国产资源在线一区| 日本一区二区成人在线| 波多野结衣中文字幕一区二区三区| 最新成人av在线| 欧美视频在线播放| 精品一区二区三区影院在线午夜| 久久综合色鬼综合色| 国产69精品一区二区亚洲孕妇 | 精品美女在线播放| 久草在线在线精品观看| 国产女同互慰高潮91漫画| 不卡电影免费在线播放一区| 亚洲精品v日韩精品| 欧美日韩精品一二三区| 精品一区二区在线播放| 中文字幕一区二区视频| 欧美日韩国产天堂| 国内成+人亚洲+欧美+综合在线 | 久久只精品国产| 99re热视频精品| 日韩中文字幕1| 亚洲国产精品二十页| 色综合天天做天天爱| 日韩黄色小视频| 国产精品的网站| 欧美一区二区福利在线| 成人福利电影精品一区二区在线观看| 亚洲精品视频在线看| 日韩欧美国产三级电影视频| 91丨porny丨在线| 久久99精品一区二区三区| 中文字幕亚洲一区二区va在线| 91.成人天堂一区| 成人av在线资源网| 久草这里只有精品视频| 亚洲黄色免费网站| 国产欧美精品一区| 91精品国产欧美一区二区成人| 成人动漫一区二区| 麻豆成人免费电影| 亚洲影视资源网| 中文字幕av一区 二区| 日韩视频一区在线观看| 色哟哟日韩精品| 懂色中文一区二区在线播放| 免费黄网站欧美| 亚洲激情图片一区| 国产精品对白交换视频| 久久青草国产手机看片福利盒子| 欧美性极品少妇| 9i在线看片成人免费| 国产精品一区在线观看你懂的| 日韩福利电影在线| 亚洲成人午夜影院| 一区二区三区高清在线| 国产精品护士白丝一区av| 久久久亚洲精品一区二区三区| 4438亚洲最大| 欧美精品 日韩| 欧美优质美女网站| 色吧成人激情小说| 99vv1com这只有精品| 成人激情动漫在线观看| 成人影视亚洲图片在线| 国产成人精品www牛牛影视| 精品一区二区三区免费视频| 美女免费视频一区| 麻豆一区二区三| 精品影视av免费| 精品一区二区在线观看| 国内精品在线播放| 国产91精品精华液一区二区三区 | 亚洲五码中文字幕| 亚洲最大成人综合| 亚洲观看高清完整版在线观看| 亚洲精品老司机| 亚洲成精国产精品女| 视频一区视频二区中文| 首页国产欧美久久| 久久精品理论片| 国产乱码字幕精品高清av | 久久精品国产澳门| 狠狠色综合播放一区二区| 久久激情五月婷婷| 福利一区在线观看| 色综合久久久久网| 欧美日韩在线三区| 欧美一区二区三区不卡| 精品福利二区三区| 欧美高清在线视频| 亚洲综合丁香婷婷六月香| 日本亚洲免费观看| 国产一区二区视频在线播放| 成人免费看片app下载| 色婷婷久久一区二区三区麻豆| 欧美日韩亚洲综合| 精品国内片67194| √…a在线天堂一区| 亚洲国产精品麻豆| 久久国产福利国产秒拍| 国产成人午夜视频| 欧美视频中文字幕| 久久久午夜电影| 亚洲成人免费av| 国产91对白在线观看九色| 91黄色在线观看| 精品国产网站在线观看| 国产精品久久久久7777按摩 | 欧美久久久久久蜜桃| 精品精品国产高清a毛片牛牛 | 中文子幕无线码一区tr| 亚洲综合色丁香婷婷六月图片| 美女视频免费一区| 在线亚洲欧美专区二区| 亚洲精品一区二区三区蜜桃下载| 亚洲欧美日韩国产综合在线| 美女精品自拍一二三四| 91国偷自产一区二区开放时间 | 一本色道久久加勒比精品 | 国产精品一区不卡| 欧美最猛黑人xxxxx猛交| 国产性天天综合网| 视频在线观看国产精品| 91丨porny丨户外露出| 精品对白一区国产伦| 亚洲一区二区三区视频在线| 国产一区二区三区av电影| 欧美日韩在线不卡| 亚洲欧美韩国综合色| 成人晚上爱看视频| 欧美v亚洲v综合ⅴ国产v| 亚洲一二三区视频在线观看| 成人动漫一区二区在线| 亚洲精品在线免费播放| 亚洲日本中文字幕区| 国产精品1区2区3区| 制服丝袜成人动漫| 亚洲午夜精品在线| 色综合色综合色综合| 亚洲欧洲无码一区二区三区| 国产一区二区三区美女| 日韩美女视频一区二区在线观看| 亚洲欧美偷拍三级| 99热精品一区二区| 欧美极品少妇xxxxⅹ高跟鞋 | 麻豆免费看一区二区三区| 日本高清不卡在线观看| 亚洲日本乱码在线观看| 国产99精品在线观看| 久久一区二区三区国产精品| 激情六月婷婷久久| 欧美一区二区不卡视频| 三级亚洲高清视频| 精品视频一区二区三区免费| 偷拍一区二区三区四区| 欧美精品自拍偷拍| 亚洲va欧美va天堂v国产综合|