⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 preface.html

📁 Thinking in c++ 2nd edition,c++编程思想(第2版)
💻 HTML
📖 第 1 页 / 共 4 页
字号:
released.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia"><B>Chapter 14: Inheritance and
Composition</B>. Data abstraction allows you to create new types from scratch,
but with composition and inheritance, you can create new types from existing
types. With composition, you assemble a new type using other types as pieces,
and with inheritance, you create a more specific version of an existing type. In
this chapter you&#8217;ll learn the syntax, how to redefine functions, and the
importance of construction and destruction for inheritance and
composition.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia"><B>Chapter 15: Polymorphism and virtual
Functions</B>. On your own, you might take nine months to discover and
understand this cornerstone of OOP. Through small, simple examples, you&#8217;ll
see how to create a family of types with inheritance and manipulate objects in
that family through their common base class. The <B>virtual</B> keyword allows
you to treat all objects in this family generically, which means that the bulk
of your code doesn&#8217;t rely on specific type information. This makes your
programs extensible, so building programs and code maintenance is easier and
cheaper.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia"><B>Chapter 16: Introduction to
Templates</B>.<B> </B>Inheritance and composition allow you to reuse object
code, but that doesn&#8217;t solve all of your reuse needs. Templates allow you
to reuse <I>source</I> code by providing the compiler with a way to substitute
type names in the body of a class or function. This supports the use of
<I>container class </I>libraries, which are important tools for the rapid,
robust development of object-oriented programs (the Standard C++ Library
includes a significant library of container classes). This chapter gives you a
thorough grounding in this essential subject.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Additional topics (and more advanced
subjects) are available in Volume 2 of this book, which can be downloaded from
the Web site
<I>www.BruceEckel.com</I>.</FONT><A NAME="_Toc312373773"></A><A NAME="_Toc462979673"></A><A NAME="_Toc472654669"></A><BR></P></DIV>
<A NAME="Heading9"></A><FONT FACE = "Verdana"><H2 ALIGN="LEFT">
Exercises</H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">I&#8217;ve discovered that exercises are
exceptionally useful during a seminar to complete a student&#8217;s
understanding, so you&#8217;ll find a set at the end of each chapter. The number
of exercises has been greatly increased over the number in the first edition.
</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Many of the exercises are fairly simple
so that they can be finished in a reasonable amount of time in a classroom
situation or lab section while the instructor observes, making sure all students
are absorbing the material. Some exercises are a bit more challenging to keep
advanced students entertained. The bulk of the exercises are designed to be
solved in a short time and are intended only to test and polish your knowledge
rather than present major challenges (presumably, you&#8217;ll find those on
your own &#8211; or more likely, they&#8217;ll find
you).</FONT><A NAME="_Toc462979674"></A><A NAME="_Toc472654670"></A><BR></P></DIV>
<A NAME="Heading10"></A><FONT FACE = "Verdana"><H3 ALIGN="LEFT">
Exercise solutions<BR><A NAME="Index21"></A><A NAME="Index22"></A></H3></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Solutions to selected exercises can be
found in the electronic document <I>The Thinking in C++ Annotated Solution
Guide</I>, available for a small fee from
<I>www.BruceEckel.com</I>.</FONT><A NAME="_Ref310733137"></A><A NAME="_Toc312373774"></A><A NAME="_Toc462979675"></A><A NAME="_Toc472654671"></A><BR></P></DIV>
<A NAME="Heading11"></A><FONT FACE = "Verdana"><H2 ALIGN="LEFT">
Source code</H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">The
<A NAME="Index23"></A><A NAME="Index24"></A>source code for this book is
copyrighted freeware, distributed via the Web site <I>www.BruceEckel.com</I>.
The <A NAME="Index25"></A>copyright prevents you from republishing the code in
print media without permission, but you are granted the right to use it in many
other situations (see below).</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">The code is available in a zipped file,
designed to be extracted for any platform that has a &#8220;zip&#8221; utility
(most do; you can search the Internet to find a version for your platform if you
don&#8217;t already have one installed). In the starting directory where you
unpacked the code you will find the following copyright notice:</FONT><BR></P></DIV>

<BLOCKQUOTE><FONT SIZE = "+1"><PRE>//:! :Copyright.txt
Copyright (c) 2000, Bruce Eckel
Source code file from the book "Thinking in C++"
All rights reserved EXCEPT as allowed by the
following statements: You can freely use this file
for your own work (personal or commercial),
including modifications and distribution in
executable form only. Permission is granted to use
this file in classroom situations, including its
use in presentation materials, as long as the book
"Thinking in C++" is cited as the source. 
Except in classroom situations, you cannot copy
and distribute this code; instead, the sole
distribution point is http://www.BruceEckel.com 
(and official mirror sites) where it is
available for free. You cannot remove this
copyright and notice. You cannot distribute
modified versions of the source code in this
package. You cannot use this file in printed
media without the express permission of the
author. Bruce Eckel makes no representation about
the suitability of this software for any purpose.
It is provided "as is" without express or implied
warranty of any kind, including any implied
warranty of merchantability, fitness for a
particular purpose, or non-infringement. The entire
risk as to the quality and performance of the
software is with you. Bruce Eckel and the
publisher shall not be liable for any damages
suffered by you or any third party as a result of
using or distributing this software. In no event 
will Bruce Eckel or the publisher be liable for 
any lost revenue, profit, or data, or for direct,
indirect, special, consequential, incidental, or
punitive damages, however caused and regardless of
the theory of liability, arising out of the use of
or inability to use software, even if Bruce Eckel
and the publisher have been advised of the
possibility of such damages. Should the software
prove defective, you assume the cost of all
necessary servicing, repair, or correction. If you
think you've found an error, please submit the
correction using the form you will find at
www.BruceEckel.com. (Please use the same
form for non-code errors found in the book.)
///:~</PRE></FONT></BLOCKQUOTE><DIV ALIGN="LEFT"><P><TT><FONT FACE="Courier New" SIZE=2></FONT></TT><BR></P></DIV>

<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">You may use the code in your projects and
in the classroom as long as the copyright notice is
retained.</FONT><A NAME="_Toc312373776"></A><A NAME="_Toc462979676"></A><A NAME="_Toc472654672"></A><BR></P></DIV>
<A NAME="Heading12"></A><FONT FACE = "Verdana"><H2 ALIGN="LEFT">
Language standards</H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Throughout this book, when referring to
conformance to the ISO C standard, I will generally just say
&#8216;C<A NAME="Index26"></A><A NAME="Index27"></A>.&#8217; Only if it is
necessary to distinguish between Standard C and older, pre-Standard versions of 
C will I make a distinction.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">At this writing the
<A NAME="Index28"></A><A NAME="Index29"></A><A NAME="Index30"></A>C++ Standards
Committee was finished working on the language. Thus, I will use the term
<I>Standard C++<A NAME="Index31"></A><A NAME="Index32"></A></I>
<A NAME="Index33"></A> to refer to the standardized language. If I simply refer
to C++ you should assume I mean &#8220;Standard C++.&#8221;</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">There is some confusion over the actual
name of the C++ Standards Committee and the name of the standard itself. Steve
Clamage, the committee chair, clarified this:</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia"><I>There are two C++ standardization
committees: The NCITS (formerly X3) J16 committee and the ISO JTC1/SC22/WG14
committee. ANSI charters NCITS to create technical committees for developing
American national standards. </I></FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia"><I>J16 was chartered in 1989 to create an
American standard for C++. In about 1991 WG14 was chartered to create an
international standard. The J16 project was converted to a "Type I"
(International) project and subordinated to the ISO standardization effort.
</I></FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia"><I>The two committees meet at the same
time at the same location, and the J16 vote constitutes the American vote on
WG14. WG14 delegates technical work to J16. WG14 votes on the technical work of
J16. </I></FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia"><I>The C++ standard was originally
created as an ISO standard. ANSI later voted (as recommended by J16) to adopt
the ISO C++ standard as the American standard for C++.</I></FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Thus, &#8216;ISO&#8217; is the correct
way to refer to the C++
Standard.</FONT><A NAME="_Toc312373777"></A><A NAME="_Toc462979677"></A><A NAME="_Toc472654673"></A><BR></P></DIV>
<A NAME="Heading13"></A><FONT FACE = "Verdana"><H3 ALIGN="LEFT">
Language support</H3></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Your <A NAME="Index34"></A>compiler may
not support all of the features discussed in this book, especially if you
don&#8217;t have the newest version of the compiler. Implementing a language
like C++ is a Herculean task, and you can expect that the features will appear
in pieces rather than all at once. But if you attempt one of the examples in the
book and get a lot of errors from the compiler, it&#8217;s not necessarily a bug
in the code or the compiler; it may simply not be implemented in your particular
compiler
yet.</FONT><A NAME="_Toc462979678"></A><A NAME="_Toc312373778"></A><A NAME="_Toc472654674"></A><BR></P></DIV>
<A NAME="Heading14"></A><FONT FACE = "Verdana"><H2 ALIGN="LEFT">
The book&#8217;s CD ROM</H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">The primary content of the CD ROM
packaged in the back of this book is a &#8220;seminar on
<A NAME="Index35"></A>CD ROM&#8221; titled <I>Thinking in C: Foundations for
Java &amp; C++</I> by Chuck Allison (published by MindView, Inc., and also
available in quantities at <I>www.BruceEckel.com</I>). This contains many hours
of audio lectures and slides, and can be viewed on most computers if you have a
CD ROM player and a sound system. </FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">The goal of <I>Thinking in C</I> is to
take you carefully through the fundamentals of the C language. It focuses on the
knowledge necessary for you to be able to move on to the C++ or
<A NAME="Index36"></A>Java languages instead of trying to make you an expert in
all the dark corners of C. (One of the reasons for using a higher-level language
like C++ or Java is precisely so we can avoid many of these dark corners.) It
also contains exercises and guided solutions. Keep in mind that because Chapter
3 of this book goes beyond the <I>Thinking in C </I>CD, the CD is not a
replacement for that chapter, but should be used instead as a preparation for
this book.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Please note that the CD ROM is
browser-based, so you should have a Web browser installed on your machine before
using
it.</FONT><A NAME="_Toc462979679"></A><A NAME="_Toc472654675"></A><BR></P></DIV>
<A NAME="Heading15"></A><FONT FACE = "Verdana"><H2 ALIGN="LEFT">
CD ROMs, seminars,<BR>and consulting</H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">There are
<A NAME="Index37"></A><A NAME="Index38"></A><A NAME="Index39"></A>seminars-on-CD-ROM
planned to cover Volume 1 and Volume 2 of this book. These comprise many hours

⌨️ 快捷键说明

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