没有合适的资源?快使用搜索试试~ 我知道了~
首页Beginning c++ (作者 ivor horton)
资源详情
资源推荐
Horton
Shelve in
Programming Languages/C++
User level:
Beginning–Advanced
www.apress.com
SOURCE CODE ONLINE
BOOKS FOR PROFESSIONALS BY PROFESSIONALS
®
Beginning C++
Beginning C++ is a tutorial for beginners in C++ and discusses a subset of C++ that
is suitable for beginners. The language syntax corresponds to the C++14 standard.
This book is environment neutral and does not presume any specific operating system
or program development system. There is no assumption of prior programming
knowledge.
All language concepts that are explained in the book are illustrated with working
program examples. Most chapters include exercises for you to test your knowledge.
Code downloads are provided for examples from the text and solutions to the
exercises and there is an additional download for a more substantial project for you to
try when you have finished the book.
This book introduces the elements of the C++ standard library that provide
essential support for the language syntax that is discussed. While the Standard
Template Library (STL) is not discussed to a significant extent, a few elements from the
STL that are important to the notion of modern C++ are introduced and applied.
You’ll learn:
• How to work with fundamental C++ data types and do calculations
• How to build logic into a program using loops, choices, decisions and more
• How to work with arrays, vectors, and strings
• How to use raw pointers and smart pointers
• How to program with functions and deal with program files and
pre-processing directives
• How to define your own data types using classes and class operations
• How to signal and handle errors using exceptions
• How to define and use function templates and class templates
• How to do file input and output with C++
RELATED
9781484 200087
55999
ISBN 978-1-4842-0008-7
www.allitebooks.com
v
Contents at a Glance
About the Author ������������������������������������������������������������������������������������������������������������� xxiii
About the Technical Reviewer ������������������������������������������������������������������������������������������ xxv
Introduction �������������������������������������������������������������������������������������������������������������������� xxvii
Chapter 1 ■
: Basic Ideas ������������������������������������������������������������������������������������������������������1
Chapter 2 ■ : Introducing Fundamental Types of Data �������������������������������������������������������23
Chapter 3 ■ : Working with Fundamental Data Types ���������������������������������������������������������55
Chapter 4 ■ : Making Decisions ������������������������������������������������������������������������������������������79
Chapter 5 ■ : Arrays and Loops �����������������������������������������������������������������������������������������105
Chapter 6 ■ : Pointers and References ������������������������������������������������������������������������������151
Chapter 7 ■ : Working with Strings �����������������������������������������������������������������������������������185
Chapter 8 ■ : Defining Functions ���������������������������������������������������������������������������������������213
Chapter 9 ■ : Lambda Expressions ������������������������������������������������������������������������������������271
Chapter 10 ■ : Program Files and Preprocessing Directives ���������������������������������������������287
Chapter 11 ■ : Defining Your Own Data Types �������������������������������������������������������������������315
Chapter 12 ■ : Operator Overloading ���������������������������������������������������������������������������������365
Chapter 13 ■ : Inheritance ������������������������������������������������������������������������������������������������399
Chapter 14 ■ : Polymorphism ��������������������������������������������������������������������������������������������429
www.allitebooks.com
■ Contents at a GlanCe
vi
Chapter 15 ■ : Runtime Errors and Exceptions �����������������������������������������������������������������463
Chapter 16 ■ : Class Templates �����������������������������������������������������������������������������������������495
Chapter 17 ■ : File Input and Output ���������������������������������������������������������������������������������533
Index ���������������������������������������������������������������������������������������������������������������������������������593
www.allitebooks.com
xxvii
Introduction
Welcome to Beginning C++. is is a revised and updated version of my previous book, Beginning ANSI C++. e C++
language has been extended and improved considerably since the previous book, so much so that it was no longer
possible to squeeze detailed explanations of all of C++ in a single book. is tutorial will teach enough of the essential
C++ language and Standard Library features to enable you to write your own C++ applications. With the knowledge
from this book you should have no diculty in extending the depth and scope of your C++ expertise. C++ is much
more accessible than many people assume. I have assumed no prior programming knowledge. If you are keen to
learn and have an aptitude for thinking logically, getting a grip on C++ will be easier than you might imagine. By
developing C++ skills, you’ll be learning a language that is already used by millions, and that provides the capability
for application development in just about any context.
e C++ language in this book corresponds to the latest ISO standard, commonly referred to as C++ 14. C++ 14 is
a minor extension over the previous standard, C++ 11, so there is very little in the book that is C++ 14 specic. All the
examples in the book can be compiled and executed using C++ 11-conforming compilers that are available now.
Using the Book
To learn C++ with this book, you’ll need a compiler that conforms reasonably well to the C++ 11 standard and a text
editor suitable for working with program code. ere are several compilers available currently that are reasonably C++
11 compliant, some of which are free.
e GCC compiler that is produced by the GNU Project has comprehensive support for C++ 11 and it is open
source and free to download. Installing GCC and putting it together with a suitable editor can be a little tricky if you
are new to this kind of thing. An easy way to install GCC along with a suitable editor is to download Code::Blocks
from http://www.codeblocks.org. Code::Blocks is a free IDE for Linux, Apple Mac OS X, and Microsoft Windows. It
supports program development using several compilers including compilers for GCC, Clang, and open Watcom. is
implies you get support for C, C++, and Fortran.
Another possibility is to use Microsoft Visual C++ that runs under Microsoft Windows. It is not fully compliant
with C++ 11, but it’s getting there. e free version is available as Microsoft Visual Studio 2013 Express and at the
time of writing this will compile most of the examples, and should compile them all eventually. You can download
it from http://www.microsoft.com/en-us/download/details.aspx?id=43733. While the Microsoft Visual
C++ compiler is more limited than GCC, in terms of the extent to which C++ 11 is supported, you get a professional
editor and support for other languages such as C# and Basic. Of course, you can always install both! ere are other
compilers that support C++ 11, which you can nd with a quick online search.
I’ve organized the material in this book to be read sequentially, so you should start at the beginning and keep
going until you reach the end. However, no one ever learned programming by just reading a book. You’ll only learn
how to program in C++ by writing code, so make sure you key in all the examples—don’t just copy them from the
download les—and compile and execute the code that you’ve keyed in. is might seem tedious at times, but it’s
surprising how much just typing in C++ statements will help your understanding, especially when you may feel you’re
struggling with some of the ideas. If an example doesn’t work, resist the temptation to go straight back to the book to
see why. Try to gure out from your code what is wrong. is is good practice for what you’ll have to do when you are
developing C++ applications for real.
www.allitebooks.com
剩余619页未读,继续阅读
qianshanxue11
- 粉丝: 34
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功