权威 C++ 书籍指南和列表

2023-11-23

这个问题试图从每年出版的数十本糟糕的 C++ 书籍中收集少数珍珠。

与许多其他编程语言(通常是从 Internet 上的教程中学习)不同,很少有人能够在不学习一本写得很好的 C++ 书籍的情况下快速学习 C++。对于这样做来说,它太大太复杂了。事实上,它是如此庞大和复杂,以至于有很多非常糟糕的 C++ 书籍在那里。我们不是在谈论糟糕的风格,而是在谈论运动之类的事情明显的事实错误 and 宣扬极其糟糕的编程风格.

请编辑已接受的答案以提供优质书籍以及大概的技能水平——最好 after 讨论你的添加C++ 聊天室。 (如果常客不同意推荐,他们可能会无情地撤销你的工作。)为你个人阅读/受益的每本书添加一个简短的简介/描述。请随意讨论质量、标题等。符合标准的书籍将被添加到列表中。由 C 和 C++ 用户协会 (ACCU) 审阅的书籍包含该审阅的链接。

*Note: FAQs and other resources can be found in the C++ tag info and under c++-faq.


Beginner

入门,没有编程经验

Book Author(s) Description review
C++ Primer*

* Not to be confused with C++ Primer Plus (Stephen Prata), with a significantly less favorable review.
Stanley Lippman, Josée Lajoie, and Barbara E. Moo (updated for C++11) Coming at 1k pages, this is a very thorough introduction into C++ that covers just about everything in the language in a very accessible format and in great detail. The fifth edition (released August 16, 2012) covers C++11. [Review]
Programming: Principles and Practice Using C++ Bjarne Stroustrup, 2nd Edition - May 25, 2014 (updated for C++11/C++14) An introduction to programming using C++ by the creator of the language. A good read, that assumes no previous programming experience, but is not only for beginners.

入门,有编​​程经验

Book Author(s) Description review
A Tour of C++ Bjarne Stroustrup (2nd edition for C++17, 3rd edition for C++20) The “tour” is a quick (about 180 pages and 14 chapters) tutorial overview of all of standard C++ (language and standard library, and using C++11) at a moderately high level for people who already know C++ or at least are experienced programmers. This book is an extended version of the material that constitutes Chapters 2-5 of The C++ Programming Language, 4th edition.
Accelerated C++ Andrew Koenig and Barbara Moo, 1st Edition - August 24, 2000 This basically covers the same ground as the C++ Primer, but does so in a quarter of its space. This is largely because it does not attempt to be an introduction to programming, but an introduction to C++ for people who've previously programmed in some other language. It has a steeper learning curve, but, for those who can cope with this, it is a very compact introduction to the language. (Historically, it broke new ground by being the first beginner's book to use a modern approach to teaching the language.) Despite this, the C++ it teaches is purely C++98. [Review]

最佳实践

Book Author(s) Description review
Effective C++ Scott Meyers, 3rd Edition - May 22, 2005 This was written with the aim of being the best second book C++ programmers should read, and it succeeded. Earlier editions were aimed at programmers coming from C, the third edition changes this and targets programmers coming from languages like Java. It presents ~50 easy-to-remember rules of thumb along with their rationale in a very accessible (and enjoyable) style. For C++11 and C++14 the examples and a few issues are outdated and Effective Modern C++ should be preferred. [Review]
Effective Modern C++ Scott Meyers This book is aimed at C++ programmers making the transition from C++03 to C++11 and C++14. This book can be treated as a continuation and "correction" of some parts of the previous book - "Effective C++". They don't cover the same things, but keep similar item-based themes. [Review]
Effective STL Scott Meyers This aims to do the same to the part of the standard library coming from the STL what Effective C++ did to the language as a whole: It presents rules of thumb along with their rationale.

中间的

Book Author(s) Description review
More Effective C++ Scott Meyers Even more rules of thumb than Effective C++. Not as important as the ones in the first book, but still good to know.
Exceptional C++ Herb Sutter Presented as a set of puzzles, this has one of the best and thorough discussions of the proper resource management and exception safety in C++ through Resource Acquisition is Initialization (RAII) in addition to in-depth coverage of a variety of other topics including the pimpl idiom, name lookup, good class design, and the C++ memory model. [Review]
More Exceptional C++ Herb Sutter Covers additional exception safety topics not covered in Exceptional C++, in addition to discussion of effective object-oriented programming in C++ and correct use of the STL. [Review]
Exceptional C++ Style Herb Sutter Discusses generic programming, optimization, and resource management; this book also has an excellent exposition of how to write modular code in C++ by using non-member functions and the single responsibility principle. [Review]
C++ Coding Standards Herb Sutter and Andrei Alexandrescu “Coding standards” here doesn't mean “how many spaces should I indent my code?” This book contains 101 best practices, idioms, and common pitfalls that can help you to write correct, understandable, and efficient C++ code. [Review]
C++ Templates: The Complete Guide David Vandevoorde and Nicolai M. Josuttis This is the book about templates as they existed before C++11. It covers everything from the very basics to some of the most advanced template metaprogramming and explains every detail of how templates work (both conceptually and at how they are implemented) and discusses many common pitfalls. Has excellent summaries of the One Definition Rule (ODR) and overload resolution in the appendices. A second edition covering C++11, C++14 and C++17 has been already published. [Review]
C++ 17 - The Complete Guide Nicolai M. Josuttis This book describes all the new features introduced in the C++17 Standard covering everything from the simple ones like 'Inline Variables', 'constexpr if' all the way up to 'Polymorphic Memory Resources' and 'New and Delete with over aligned Data'. [Review]
C++ 20 - The Complete Guide Nicolai M. Josuttis This book presents all the new language and library features of C++20. It covers the motivation and context of each new feature with examples and background information. The focus is on how these features impact day-to-day programming, what it means to combine them, and how to benefit from C++20 in practice. (Note that this book was published step-by-step, and the first edition is now complete.)
C++ in Action Bartosz Milewski This book explains C++ and its features by building an application from the ground up. [Review]
Functional Programming in C++ Ivan Čukić This book introduces functional programming techniques to modern C++ (C++11 and later). A very nice read for those who want to apply functional programming paradigms to C++.

Advanced

Book Author(s) Description review
Modern C++ Design Andrei Alexandrescu A groundbreaking book on advanced generic programming techniques. Introduces policy-based design, type lists, and fundamental generic programming idioms then explains how many useful design patterns (including small object allocators, functors, factories, visitors, and multi-methods) can be implemented efficiently, modularly, and cleanly using generic programming. [Review]
C++ Template Metaprogramming David Abrahams and Aleksey Gurtovoy
C++ Concurrency In Action Anthony Williams A book covering C++11 concurrency support including the thread library, the atomics library, the C++ memory model, locks and mutexes, as well as issues of designing and debugging multithreaded applications. A second edition covering C++14 and C++17 has already been published. [Review]
Advanced C++ Metaprogramming Davide Di Gennaro A pre-C++11 manual of TMP techniques, focused more on practice than theory. There are a ton of snippets in this book, some of which are made obsolete by type traits, but the techniques, are nonetheless useful to know. If you can put up with the quirky formatting/editing, it is easier to read than Alexandrescu, and arguably, more rewarding. For more experienced developers, there is a good chance that you may pick up something about a dark corner of C++ (a quirk) that usually only comes about through extensive experience.
Large Scale C++ volume I, Process and architecture (2020) John Lakos Part one of a three-part series extending the older book 'Large Scale C++ Design'. Lakos explains battle-tested techniques to manage very big C++ software projects. If you work in a big C++ software project this is a great read, detailing the relationship between physical and logical structure, strategies for components, and their reuse. [Review]

参考风格 - 所有级别

Book Author(s) Description review
The C++ Programming Language Bjarne Stroustrup (updated for C++11) The classic introduction to C++ by its creator. Written to parallel the classic K&R, this indeed reads very much like it and covers just about everything from the core language to the standard library, to programming paradigms to the language's philosophy. [Review]
Note: All releases of the C++ standard are tracked in the question "Where do I find the current C or C++ standard documents?".
C++ Standard Library Tutorial and Reference Nicolai Josuttis (updated for C++11) The introduction and reference for the C++ Standard Library. The second edition (released on April 9, 2012) covers C++11. [Review]
The C++ IO Streams and Locales Angelika Langer and Klaus Kreft There's very little to say about this book except that if you want to know anything about streams and locales, then this is the one place to find definitive answers. [Review]

C++11/14/17/... 参考文献:

  • 工作草案,编程语言 C++ 标准产生于LaTeX 源代码发布在 GitHub 上.

  • C++ 标准论文、最新标准工作草案:ISO工作草案

  • The C++11/14/17标准(INCITS/ISO/IEC 14882:2011/2014/2017)当然,这是所有是否是 C++ 的最终仲裁者。但请注意,它纯粹是作为参考有经验的用户愿意投入大量的时间和精力来理解它。 C++17 标准以电子形式发布,售价 198 瑞士法郎。

  • C++17 标准可用,但似乎不是一种经济的形式 –直接来自 ISO售价 198 瑞士法郎(约合 200 美元)。对于大多数人来说,标准化前的最终草案绰绰有余(而且免费)。许多人会更喜欢甚至更新的草案,记录了 C++20 中可能包含的新功能。

  • C++20 草案可以在 GitHub 上找到也有一些年纪较大的.

  • 新 C++ 概述 (C++11/14)(仅限 PDF)(斯科特·迈耶斯)(更新为 C++14) 这些是 Scott Meyers 提供的为期三天的培训课程的演示材料(幻灯片和一些讲义),Scott Meyers 是一位备受尊敬的 C++ 作者。尽管项目清单很短,但质量很高。

  • The C++ 核心指南 (C++11/14/17/...)(由 Bjarne Stroustrup 和 Herb Sutter 编辑)是一个不断发展的在线文档,其中包含一组良好使用现代 C++ 的指南。该指南侧重于相对较高级别的问题,例如接口、资源管理、内存管理以及影响应用程序架构和库设计的并发性。该项目是Bjarne Stroustrup 等人在 CppCon'15 上宣布并欢迎社区的贡献。大多数指南都补充有基本原理和示例以及可能的工具支持的讨论。许多规则专门设计为可由静态分析工具自动检查。

  • The C++ 超级常见问题解答(Marshall Cline、Bjarne Stroustrup 等)是标准 C++ 基金会的一项努力,旨在统一以前由 Marshall Cline 和 Bjarne Stroustrup 单独维护的 C++ 常见问题解答,并纳入新的贡献。这些项目主要解决中级水平的问题,并且通常以幽默的语气编写。并非所有项目都完全符合最新版本的 C++ 标准。

  • cppreference.com (C++03/11/14/17/…)(由 Nate Kohl 发起)是一个 wiki,总结了基本的核心语言功能,并拥有 C++ 标准库的大量文档。该文档非常精确,但比官方标准文档更容易阅读,并且由于其 wiki 性质提供了更好的导航。该项目记录了 C++ 标准的所有版本,并且该站点允许过滤特定版本的显示。该项目是由 Nate Kohl 在 CppCon'14 上发表.


经典/较旧

Note:这些书中包含的某些信息可能不是最新的或不再被视为最佳实践。

  • C++的设计和演变(Bjarne Stroustrup)如果你想知道why语言就是这样,这本书就是你找到答案的地方。这涵盖了一切标准化前 of C++.

  • 对 C++ 的思考- (安德鲁·科尼格和芭芭拉·穆)[Review]

  • 高级 C++ 编程风格和习惯用法(James Coplien) 作为模式运动的前身,它描述了许多 C++ 特定的“习惯用法”。这当然是一本非常好的书,如果您有时间的话,可能仍然值得一读,但是它相当旧,并且与当前的 C++ 不太同步。

  • 大规模C++软件设计(John Lakos) Lakos 解释了管理大型 C++ 软件项目的技术。当然,如果它是最新的,那么这是一本好书。它是在 C++ 98 之前很久编写的,并且遗漏了许多对于大型项目很重要的功能(例如命名空间)。如果您需要从事大型 C++ 软件项目,您可能想阅读它,尽管您需要对此持保留态度。不要与扩展的和后来的书籍系列《大规模 C++》第 I-III 卷混淆。

  • C++ 对象模型内部(Stanley Lippman)如果您想了解虚拟成员函数通常是如何实现的,以及在多继承场景中基对象通常是如何在内存中布局的,以及所有这些如何影响性能,在这里您可以找到对此类问题的深入讨论。主题。

  • 带注释的 C++ 参考手册(Bjarne Stroustrup、Margaret A. Ellis)这本书相当过时,因为它探讨了 1989 年的 C++ 2.0 版本 - 尚未引入模板、异常、命名空间和新的强制转换。尽管如此,本书还是回顾了当时的整个 C++ 标准,解释了该语言的基本原理、可能的实现和特性。这不是一本学习C++编程原理和模式的书,而是一本了解C++语言各个方面的书。

  • Thinking in C++ (Bruce Eckel, 2nd Edition, 2000). Two volumes; is a tutorial-style free set of intro-level books. Downloads: vol 1, vol 2. Unfortunately, they're marred by a number of trivial errors (e.g. maintaining that temporaries are automatic const), with no official errata list. A partial 3rd party errata list is available at http://www.computersciencelab.com/Eckel.htm, but it is apparently not maintained.

  • 科学与工程 C++:先进技术和示例简介(约翰·巴顿和李·纳克曼) 这是一本全面且非常详细的书,试图在数值方法的背景下解释和利用 C++ 中的所有可用功能。当时它引入了几种新技术,例如奇怪的重复模板模式(CRTP,也称为 Barton-Nackman 技巧)。 它开创了维度分析和自动微分等多项技术。 它附带了大量可编译且有用的代码,从表达式解析器到 Lapack 包装器。 代码是仍然可以在线使用。 不幸的是,这些书在风格和 C++ 功能方面已经有些过时了,但在当时(1994 年,STL 之前),它是一部令人难以置信的杰作。 关于动态继承的章节理解起来有点复杂,而且用处不大。 这本经典书籍的更新版本如果包含移动语义和从 STL 中学到的经验教训,那就太好了。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

权威 C++ 书籍指南和列表 的相关文章

  • 具有子列表属性映射问题的自动映射器

    我有以下型号 Models public class Dish Required public Int64 ID get set Required public string Name get set Required public str
  • 进程何时获得 SIGABRT(信号 6)?

    C 中进程获得 SIGABRT 的场景有哪些 该信号是否始终来自进程内部 或者该信号可以从一个进程发送到另一个进程吗 有没有办法识别哪个进程正在发送该信号 abort 向调用进程发送SIGABRT信号 就是这样abort 基本上有效 abo
  • 为什么libc++的shared_ptr实现使用完整内存屏障而不是宽松内存屏障?

    在boost的实现中shared ptr 它用放松内存排序以增加其引用计数 https github com boostorg smart ptr blob master include boost smart ptr detail sp
  • OpenCv读/写视频色差

    我试图简单地使用 openCV 打开视频 处理帧并将处理后的帧写入新的视频文件 我的问题是 即使我根本不处理帧 只是打开视频 使用 VideoCapture 读取帧并使用 VideoWriter 将它们写入新文件 输出文件看起来比输入更 绿
  • 使用具有现有访问令牌的 Google API .NET 客户端

    用例如下 移动应用程序正在通过 Google 对用户进行身份验证 并且在某些时候 我们需要将用户的视频发布到他的 YouTube 帐户 出于实际原因 实际发布应该由后端完成 已经存储在那里的大文件 由于用户已经通过应用程序的身份验证 因此应
  • 以编程方式检查页面是否需要基于 web.config 设置进行身份验证

    我想知道是否有一种方法可以检查页面是否需要基于 web config 设置进行身份验证 基本上如果有这样的节点
  • 32 位应用程序的特征最大矩阵大小

    所以 我正在寻找Eigen http eigen tuxfamily org index php title Main Page当我尝试声明大于 10000x10000 的矩阵时 包崩溃 我需要声明一个像这样的矩阵 可靠地大约有 13000
  • C++:重写已弃用的虚拟方法时出现弃用警告

    我有一个纯虚拟类 它有一个纯虚拟方法 应该是const 但不幸的是不是 该接口位于库中 并且该类由单独项目中的其他几个类继承 我正在尝试使用这个方法const不会破坏兼容性 至少在一段时间内 但我找不到在非常量方法重载时产生警告的方法 以下
  • 如何配置 WebService 返回 ArrayList 而不是 Array?

    我有一个在 jax ws 上实现的 java Web 服务 此 Web 服务返回用户的通用列表 它运行得很好 Stateless name AdminToolSessionEJB RemoteBinding jndiBinding Admi
  • 当前的 c++ 工作草案与当前标准有何不同

    通过搜索该标准的 PDF 版本 我最终找到了这个链接C 标准措辞草案 http www open std org jtc1 sc22 wg21 docs papers 2012 n3376 pdf从 2011 年开始 我意识到我可以购买最终
  • 即使手动设置显示环境变量后,WSL Ubuntu 也会显示“错误:无法打开显示”

    我在 WSL Ubuntu 上使用 g 我使用 git 克隆了 GLFW 存储库 使用了ccmake命令配置并生成二进制文件 然后使用make在 build 目录中最终创建 a文件 我安装了所有OpenGL相关的库 usr ld 我不记得我
  • Qt 创建布局并动态添加小部件到布局

    我正在尝试在 MainWindow 类中动态创建布局 我有四个框架 它们是用网格布局对象放置的 每个框架都包含一个自定义的 ClockWidget 我希望 ClockWidget 对象在调整主窗口大小时相应地调整大小 因此我需要将它们添加到
  • 生产代码中的 LRU 实现

    我有一些 C 代码 需要使用 LRU 技术实现缓存替换 目前我知道两种实现LRU缓存替换的方法 每次访问缓存数据时使用时间戳 最后比较替换时的时间戳 使用缓存项的堆栈 如果最近访问过它们 则将它们移动到顶部 因此最后底部将包含 LRU 候选
  • 通过 NHibernate 进行查询,无需 N+1 - 包含示例

    我有一个 N 1 问题 我不知道如何解决它 可以在这个问题的底部找到完全可重复的样本 因此 如果您愿意 请创建数据库 设置 NUnit 测试和所有附带的类 并尝试在本地消除 N 1 这是我遇到的真实问题的匿名版本 众所周知 这段代码对于帮助
  • 耐用功能是否适合大量活动?

    我有一个场景 需要计算 500k 活动 都是小算盘 由于限制 我只能同时计算 30 个 想象一下下面的简单示例 FunctionName Crawl public static async Task
  • 运算符“==”不能应用于“int”和“string”类型的操作数

    我正在编写一个程序 我想到了一个数字 然后计算机猜测了它 我一边尝试一边测试它 但我不断收到不应该出现的错误 错误是主题标题 我使用 Int Parse 来转换我的字符串 但我不知道为什么会收到错误 我知道它说 不能与整数一起使用 但我在网
  • 用于 C# XNA 的 Javascript(或类似)游戏脚本

    最近我准备用 XNA C 开发另一个游戏 上次我在 XNA C 中开发游戏时 遇到了必须向游戏中添加地图和可自定义数据的问题 每次我想添加新内容或更改游戏角色的某些值或其他内容时 我都必须重建整个游戏或其他内容 这可能需要相当长的时间 有没
  • 带重定向标准流的 C# + telnet 进程立即退出

    我正在尝试用 C 做一个 脚本化 telnet 项目 有点类似于Tcl期望 http expect nist gov 我需要为其启动 telnet 进程并重定向 和处理 其 stdin stdout 流 问题是 生成的 telnet 进程在
  • 是否可以在 C# 中强制接口实现为虚拟?

    我今天遇到了一个问题 试图重写尚未声明为虚拟的接口方法的实现 在这种情况下 我无法更改接口或基本实现 而必须尝试其他方法 但我想知道是否有一种方法可以强制类使用虚拟方法实现接口 Example interface IBuilder
  • 错误:无效使用不完整类型“类 Move”/未定义对 Move::NONE 的引用

    拜托 我不知道为什么这个简单的代码被拒绝 它给了我 2 个编译错误 请帮帮我 I use 代码 块 20 03 我的编译器是GNU GCC 移动 hpp class Move public Move Move int int public

随机推荐

  • 有没有办法将命名范围组合成新的命名范围?

    I have class Foo lt ActiveRecord Base named scope a lambda a conditions gt a gt a named scope b lambda b conditions gt b
  • url 中的 django 用户名,而不是 id

    在一个迷你虚拟社区中 我有一个 profile view 功能 这样我就可以查看任何注册用户的个人资料 个人资料视图函数将个人资料所属的用户的 id 作为参数 因此当我想访问用户 2 的个人资料时 我会这样调用它 http 127 0 0
  • 如何使用 PowerShell Invoke-RestMethod 发送多部分/表单数据

    我正在尝试通过 Invoke RestMethod 在与带有 F 开关的curl 类似的上下文中发送文件 卷曲示例 curl F FileName path to file name https uri to post 在powershel
  • Elasticsearch节点重启后快速恢复

    考虑 elasticsearch yml 中的以下设置 gateway recover after data nodes 3 gateway recover after time 5m gateway expected data nodes
  • Linux 中对 pthread_create 的未定义引用

    我从网上获取了以下演示https computing llnl gov tutorials pthreads include
  • C++14 中不指定对象的左值

    我在这里使用 N3936 作为参考 如果 C 14 文本有任何不同 请更正此问题 3 10以下左值和右值我们有 每个表达式都属于该分类中的基本分类之一 左值 x值或纯右值 然而 定义lvalue reads An lvalue 指定一个函数
  • C 中的按位连接

    我正在尝试在 C 中连接两个二进制数 所以如果我有1010 and 0011我希望我的结果是10100011 我写了一个我认为可以完成这项工作的简短例程 include
  • Eclipse 优化导入以包括静态导入

    有没有办法让 Eclipse 自动查找静态导入 例如 现在我终于升级到了 Junit 4 我希望能够编写 assertEquals expectedValue actualValue hit Ctrl Shift O and have Ec
  • 重置 svg 填充 css

    我想让所有 svgs 都具有相同的纯色 所以我用 svg fill ccc 但我想在 hover 上获得默认填充 如何禁用填充并恢复默认值 您可以使用以下方法执行此操作 not 并有效地设置 不悬停 的样式 svg not hover fi
  • Jupyter:安装后没有名为“imblearn”的模块

    我在 ANACONDA Navigator 上安装了 imbalanced learn 版本 0 3 1 当我使用 Jupyter Python 3 运行不平衡学习网站上的示例时 from imblearn datasets import
  • Git版本兼容性

    使用 Git 进行版本控制 与不同版本的 Git 协同工作的效果如何 有关的体验 好还是坏 是什么 长话短说 我正在考虑将 Git 用于一些计划的家庭项目 但由于我使用存储库中的默认包进行的大杂烩设置将意味着完全不同的版本 我计划在运行 U
  • 关于 C# 变量作用域与其他语言的问题

    首先声明一下 我以前没用过C 对它了解不多 我正在学习 Sebesta 的 编程语言概念第 9 版 一书 准备 编程语言 考试 当我读到以下摘录自 范围声明顺序 第246页 时 我有点困惑 例如 在 C99 C Java 中 所有局部变量的
  • 没有RTTI的shared_ptr?

    我正在尝试使用shared ptr在使用 xc32 1 34 gcc 4 5 2 的衍生版本 构建的嵌入式项目中 该项目已禁用 RTTI fno rtti include
  • 如何在 MVC3 中从 javascript 调用控制器方法?

    我使用 MVC3 架构 c net 当焦点更改到下一个字段 即密码字段 时 我需要立即将文本框内容 用户 ID 与数据库进行比较 所以我想对 User Id 字段使用 onblur 事件 然后调用 Controller 方法 谁能告诉我如何
  • 通过套接字发送和接收数组

    是否可以使用Python通过UDP套接字发送数组 我正在使用 Python 2 5 并尝试发送一个简单的数组 但它不起作用 它可以成功发送数组 但是当我尝试使用数组的一项来打印它时 程序崩溃了 我不确定错误是什么 因为我采取了预防措施将数据
  • 使用 psycopg2 将 PostgreSQL UUID 数组作为列表返回

    我有一个 SQL 语句 其中包含嵌入在ARRAY 像这样 SELECT foo ARRAY SELECT x from y AS bar 查询工作正常 但是在 psycopg2 结果游标中 数组作为字符串返回 如 1 2 3 而不是列表 我
  • CQL SELECT 大于索引非键列上的查询

    EDIT1 在原始问题之后添加了一个案例来描述问题 我希望查询不属于我的键的列 如果我理解正确的话 我需要在该列上定义一个二级索引 但是 我希望使用大于条件 不仅仅是相等条件 但这似乎仍然不受支持 我错过了什么吗 您将如何解决这个问题 我想
  • 使数组严格递增所需的最少更改

    我遇到一个问题 我们有一个正数数组 我们必须通过对数组元素进行零次或多次更改来使其严格增加 我们被问到使数组严格递增所需的最少更改次数 Example 如果数组是 1 2 9 10 3 15 因此 如果将 3 更改为 12 到 14 之间的
  • 打字稿中的 lodash _.get 函数

    经过一番谷歌搜索后 我感觉很多 lodash 的功能都可以使用本机打字稿来实现 但我找不到 get 函数的直接答案 在lodash中 使用 get函数警告1 let obj a b 1 let a get obj a b alert a 有
  • 权威 C++ 书籍指南和列表

    这个问题的答案是社区努力 编辑现有答案以改进这篇文章 目前不接受新的答案或互动 这个问题试图从每年出版的数十本糟糕的 C 书籍中收集少数珍珠 与许多其他编程语言 通常是从 Internet 上的教程中学习 不同 很少有人能够在不学习一本写得