下载  >  开发技术  >  C++  > Beginning C++17

Beginning C++17 评分:

Beginning C++17 Beginning C++17 Beginning C++17 Beginning C++17
Beginning C++17: From Novice to Professional Ivor horton Peter Van Weert Stratford-upon-Avon, Warwickshire, United Kingdom Kessel-Lo, belgium ISBN-13(pbk):978-1-48423365-8 ISBN-13( electronic):978-1-4842-3366-5 https://doi.org/10.1007/978-1-4842-3366-5 Library of Congress Control Number: 2018936369 Copyright o 2018 by Ivor Horton and Peter Van Weert This work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Steve Anglin Development Editor: Matthew Moodie Coordinating Editor: Mark Powers Cover designed by eStudio Calamar CoverimagedesignedbyFreepik(www.freepik.com Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505, e-mail orders-ny@springer-sbm.comorvisitwww.springeronline.comApressMedia,LlcisaCaliforniaLlc and the sole member(owner) is Springer Science Business Media Finance Inc(SSBM Finance Inc) SSBM Finance Inc is a Delaware corporation Forinformationontranslations,pleasee-maileditorial@apress.com;forreprint,paperback,oraudio rightspleaseemailbookpermissionsspringernature.com Apress titles may be purchased in bulk for academic, corporate, or promotional use eBook versions and licenses are also available for most titles. for more information reference our print and ebook bulk Saleswebpageatwww.apress.com/bulk-sales Any source code or other supplementary material referenced by the author in this book is available to readersonGithubviathebooksproductpagelocatedatwww.apRess.com/9781484233658.foRmore detailedinformationpleasevisitwww.apress.com/source-code Printed on acid-free paper This is for Alexander and Henry who are both going to learn programming soon If their amazing expertise with Minecraft is anything to go by, they will be brilliant at it Ivor horton For my wonderful family. For all your love and support For putting up with me never having the time to help out around the house or to play with the train set i got you for Christmas Peter Van Weert Contents About the authors About the technical reviewer mm XXv Introduction auuuaaaauauaauuaaaaauuaXvII Chapter 1: Basic Ideas RRRRRRRRRRRBRBRELD ■■■■■■■■■ Modern ct+ Standard libraries C++ Program Concepts… Source Files and header files 2334 Comments and whitespace…......……4 Preprocessing Directives and Standard Library Headers. ............4 Functions Statements…5 Data Input and Output turn statements 7 Namespaces Names and Keywords 8 Classes and objects Templates Code appearance and Programming Style.......ne 9 Creating an Executable.eseeemeseemneneeeene 10 Procedural and object-Oriented Programming. CONTENTS Representing Numbers 13 Binary Numbers…… 13 Hexadecimal numbers wwwww 14 Negative Binary Numbers 16 Octal values 17 Bi-Endian and little-Endian Systems Floating-Point Numbers Representing Characters...,.,.,…,…,20 ASCll Codes m.m.. UCS and Unicode 21 C++ source characters 22 Escape Sequences. ...................................................................22 Summary....,.,.,.,.,,.,.,,,,… 24 Chapter 2: Introducing Fundamental Types of Data mmammammnannmmnn 27 Variables, Data, and 27 Defining Integer Variables Zero nitialization 日1a Defining variables with Fixed values Integer Literals. Decimal Integer Literals Hexadecimal Literals 33 Octal Literals 34 Binary Literals...... …34 Calculations with Integers......................... 35 Compound Arithmetic Expressions 36 Assignment Operations…............…37 The op= Assignment The sizeof operator 42 CONTENTS Incrementing and Decrementing Integers 42 Postfix Increment and Decrement Operations 目日a量目面日目日面目日目目面日日目面日日正日量目面日目日面日日目面目 Defining Floating-Point variables Floating- Point literal!…… Floating-Point Calculations Pitfalls Invalid Floating-Point Results 6444 Mathematical functions Formatting Stream Output 51 Mixed Expressions and Type Conversion 53 Explicit Type Conversion 54 Old-Style Casts 日自日自日自日面日自日自日日自日日日日B日B日日B日a日日面日日面日日自日日日日面日日面日日面日日面日日日面日日1日1日 Finding the Limits......……………57 Finding other Properties of Fundamental Types...................58 Working with Character Variables 59 Working with Unicode Characters The auto Keyword 61 Summary 62 Chapter 3: Working with Fundamental Data Types mama 65 Operator Precedence and Associativity ,65 Bitwise Operators The Bitwise Shift Operators.......,,……………68 Logical Operations on Bit Patterns......... Enumerated Data Types Aliases for Data types 80 The lifetime of a variable Globa| Variab|es… :82 Summary CONTENTS Chapter 4: Making Decisions. m ma Rna Rna RR n, 89 Comparing Data values…...,.,..,.,,,… 89 Applying the Comparison Operator..,.,…,,……………,90 Comparing floating-point values............ 92 The if statement 92 Nested if statements…,,,… 96 Character Classification and conversion 97 The if-else statement. Nested if- else statements………101 Understanding nested ifs …102 ogical Operators . ,103 Logical AND 104 Logical OR 104 Logical Negation …105 Combining Logical Operators. Logical Operators on Integer operands 107 Logical Operators vs. Bitwise0 perators….......……….,108 The conditional operator. The switch statement 112 Fallthrough 116 Statement Blocks and Variable Scope 118 Initialization statements 119 Summary 120 Chapter 5: Arrays and Loops mmammamaamammmmmmmamaaa 123 Arrays. Using an Array… 123 Understanding Loops. The for l00p..…126 Avoiding Magic Numbers 128 Defining the Array Size with the Braced Initializer 130 CONTENTS Determining the Size of an array 130 Controlling a for Loop with Floating-Point values 132 More Complex for Loop control Expressions 135 The Comma Operator............. 136 The Range-Based for Loop 137 The while l0op.…,, 138 The do-While Loop .. Nested Loops. Skipping Loop iterations 145 Breaking Out of a Loop.... 146 Indefinite Loops............ 146 Controlling a for Loop with Unsigned Integers 150 Arrays of characters. Multidimensional Arrays Initializing Multidimensional Arrays..,.,.,.,.,.,…,…….158 Multidimensional Character arrays ....................................................................................160 Allocating an array at runtime. .m.mmm. 161 Alternatives to Using an Array 164 Using array<T, N> Containers 164 Using std: ector.<T> Containers.....……169 Summary…,,,,, 174 Chapter 6: Pointers and References ammm samiRA. 177 What is a pointer?… 17 The Address-Of Operator. The Indirection0 perator…......,,,,…,……181 Why Use Pointers? 183 Pointers to Type char.... 183 Arrays of Pointers 186 Constant pointers and pointers to constants 188 CONTENTS Pointers and arrays∴ 190 Pointerarithmetic.wwmwwwww.191 Using Pointer Notation with an Array Name 193 Dynamic Memory Allocation.....,,,,……196 The stack and the free store Using the new and delete0 perators…..…..,197 Dynamic Allocation of Arrays 199 Member Selection Through a Pointer …203 Hazards of dynamic Memory allocation 203 Dangling Pointers and Multiple Deallocations 204 Allocation /Deallocation mismatch 204 Memory Leaks….,…,…,…,……,,.204 Fragmentation of the Free Store 205 Golden Rule of Dynamic Memory allocation 206 Raw Pointers and smart pointers mm.m. 206 Using unique_ptr<T> Pointers….,.,,….,……….208 Using shared_ptr<T> Pointers…… 211 Understanding references . Defining References …214 Using a reference variable in a Range-Based for Loop.. 216 Summary. 217 Chapter 7: Working with Strings m amiN 219 A Better Class of String....,,,………,219 Defining string objects.............………20 Operations with String Objects.......................... 223 Accessing Characters in a string. Accessing Substrings ............... 230 Comparing strings...........,,,………230 Searching Strings.....…………….237 Modifying a String . std: string Vs. std: vector<char> 248

...展开详情
2018-04-07 上传 大小:9.68MB
举报 收藏
分享
Beginning C++17 From Novice to Professional(5th) 无水印原版pdf

Beginning C++17 From Novice to Professional(5th) 英文无水印原版pdf 第5版 pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

立即下载
高速上手c++11,14,17

C++ 是一个用户群体相当大的语言。从 C++98 的出现到 C++11 的正式定稿经历了长达十年多之 久的积累。C++14/17 则是作为对 C++11 的重要补充和优化,所有这些新标准中扩充的特性,给 C++ 这门语言注入了新的活力。那些还在坚持使用传统 C++(本书把 C++98 及其之前的 C++ 特性均称 之为传统 C++)而未接触过 C++11/14/17 的 C++ 程序员在见到诸如 Lambda 表达式这类全新特性 时,甚至会流露出『学的不是同一门语言』的惊叹之情。

立即下载
Beginning C++17, 5th Edition(英文完美版)pdf

Welcome to Beginning C++17. This is a revised and updated version of Ivor Horton’s original book called Beginning ANSI C++. The C++ language has been extended and improved considerably since then, so much so that it was no longer possible to squeeze detailed explanations of all of C++ into a single

立即下载
Beginning C++17, 5th Edition--2018

Learn how to program using the updated C++17 language. You’ll start with the basics and progress through step-by-step examples to become a working C++ programmer. All you need are Beginning C++17 and any recent C++ compiler and you’ll soon be writing real C++ programs.

立即下载
Beginning C++17_From Novice to Professional-Apress(2018).pdf

Welcome to Beginning C++17. This is a revised and updated version of Ivor Horton’s original book called Beginning ANSI C++. The C++ language has been extended and improved considerably since then, so much so that it was no longer possible to squeeze detailed explanations of all of C++ into a single

立即下载
C++17 stl cook book 中文版

这就不用说了吧,不用STL也能说自己做C++?这本2017年的新书就是介绍在C++17下如何更好地进行STL编程。介绍链接在此:https://www.amazon.com/STL-Cookbook-enhancements-programming-expressions/dp/178712049X/ref=as_li_ss_tl?_encoding=UTF8&pd_rd_i=178712049X&pd_rd_r=K7D6G81D4VM1P35P0K0S&pd_rd_w=Lh4zr&pd_rd_wg=ToJVP&psc=1&refRID=K7D6G81D4VM1P35P0K0S&linkCod

立即下载
C++ 17 N4659

这是ISO/IEC:14882 2017发行版前的最后一份草案,据说除了封面与封底有差别外,这个版本与正式版没什么差别(我也只是听说,如果你有闲钱去买一份正式版来帮忙校正那也是极好的)。 为什么要看C++标准,因为市面上的书籍都是作者基于C++标准写的(有些作者可能都没看过C++标准),这些书籍或多或少会带有作者个人的主观理解导致与标准出现偏差。

立即下载
C/C++离线中文文档(包括C++11至C++17)

实际上C++并没用很权威的中文文档. 此资源是爬取http://zh.cppreference.com/w/上的所有的页面后,再把所有链接地址替换成相对地址后的网页内容(不替换访问较慢). 使用体验已与离线文档无异. 由于爬取后是静态页面, 搜索功能不可用,极少量链接不可用.而页面又较小,建议使用一个支持默认缩放的浏览器(如chromium系)来查看. 解压后后index.html就是首页.

立即下载
Mastering the C++17 .pdf

Mastering the C++17 STL Make full use of the standard library components in C++17 Mastering the C++17 STL Make full use of the standard library components in C++17 Mastering the C++17 STL Make full use of the standard library components in C++17

立即下载
Beginning C++17, 5th Edition

学习如何使用更新的C ++ 17语言进行编程。您将从基础知识开始,逐步学习如何成为一名正常工作的C ++程序员。所有你需要的是Beginning C ++ 17和任何最新的C ++编译器,你很快就会编写真正的C ++程序。没有事先编程知识的假设。 本书中解释的所有语言概念都通过工作程序示例进行说明,所有章节都包含练习,以便您测试和练习您的知识。为文本中的所有示例和练习解决方案提供代码下载。 这个最新版本已经完全更新到最新版本的C ++ 17语言,以及所谓的现代C ++的所有约定和最佳实践。从C ++ 17开始,还介绍了为C ++ 17语言提供基本支持的C ++标准库的元素。

立即下载
Beginning C++17 C++编程入门英文原版

Beginning C++17 C++编程入门英文原版。电子版仅供预览及学习交流使用,下载后请24小时内删除,支持正版,喜欢的请购买正版书籍。

立即下载
Beginning C++17: From Novice to Profession

Beginning C++17: From Novice to Professional, 5th edition English | ISBN: 1484233654 | 2018 | PDF+EPUB This latest edition has been fully updated to the latest version of the language, C++17, and to all conventions and best practices of so-called modern C++. Beginning C++17 also introduces the ele

立即下载
Beginning C++17 From Novice to Professional(5th) epub

Beginning C++17 From Novice to Professional(5th) 英文epub 第5版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

立即下载
Beginning Rust From Novice to Professional 无水印原版pdf

Beginning Rust From Novice to Professional 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

立即下载
C++ 17: the complete guide

C++17 - The Complete Guide by Nicolai M. Josuttis Giving guidance on how to use Language and Library Features of C++17 For programmers, who want to switch to the latest version of Modern C++ C++17 is the next evolution in modern C++ programming, which is already at least partially supported by the

立即下载