[转]C++备忘录

发布时间 2023-05-31 16:51:14作者: 南水之源

转自:知乎  沈月  原文地址

本文中的图片均来自hackingcpp.com,个人认为它是有关c++编程最好的科普网站。本文只是截取了部分cheatsheet,更多详细请进入该网站查看。

  1. C++ build model

2. Memory model

3. C++ variable, object, value, type的区别

 

注意图中的memory地址从下到上依次增加

4. 四种object在memory的储存模式

5. 在不同硬件CPU/操作系统/编译器的实践上,如何做memory handling

6. c++ sequence containers, associative Containers, special Containers

 

7. Iterators(objects that point to a location, An iterator refers to a position in a container)

8. 如何确定该使用哪个sequence container

9. 有字符串作为参数的函数,应该如何选择字符串参数类型?

10. references

11. Pointer 与reference 的区别与联系,更多可以参考网文C++ Pointers and References

 

12. 写函数应该要注意哪几个点

13. Function Call Mechanics

太长了,具体请看:h/cpp - Function Call Mechanics

14. 超级适合入门的cmake语言的简单介绍Learn CMake's Scripting Language in 15 Minutes,以及cmake-based C++ projects的5个例子Introduction to CMake by Example

  • Example 1: The Hello World Example
  • Example 2: A Project with Directories
  • Example 3: Building a Shared Library (.so)
  • Example 4: Building a Static Library (.a)
  • Example 5: Using a Shared or Static Library(3rd party library)