C++

作者: 高天蒲 | 来源:发表于2019-01-24 18:06 被阅读3次

一. 配置开发环境环境

  1. 基本环境设置
    http://www.runoob.com/cplusplus/cpp-environment-setup.html
  2. CMake 编译器/链接器
    https://blog.csdn.net/xierhacker/article/details/79445339
    cpplint ?
  3. 基于VSCode
    https://lain.run/tutorials/Boost-and-Visual-Studio-Code/
    https://blogs.msdn.microsoft.com/c/2016/04/18/visual-studio-code%E7%9A%84cc%E6%89%A9%E5%B1%95%E5%8A%9F%E8%83%BD/
  4. 基于VIM

二、基础

std::x count
std::string 729
std::vector 101
std::set 15
std::string::npos 9
std::numeric_limits 7
std::make_pair 7
std::move 7
std::map 5
std::memory_order_relaxed 5
std::pair 4
std::atomic 4
std::min 4
std::sort 3
std::FILE 3
std::mutex 2
std::string::size_type 2
std::fwrite 2
std::strerror 2
std::memcpy 2
std::thread 2
std::aligned_storage 2
std::deque 2
std::memory_order::memory_order_relaxed 2
std::abort 2
std::fflush 1
std::condition_variable 1
std::fclose 1
std::memset 1
std::stringstream 1
std::upper_bound 1
std::unique_lock 1
std::memory_order_seq_cst 1
std::forward 1
std::queue 1
std::this_thread::get_id 1
std::time_t 1
std::string::reverse_iterator 1
std::vsnprintf 1
std::snprintf 1
std::rename 1
std::getenv 1
std::atomic_thread_fence 1
std::fopen 1
std::tm 1
std::memory_order_release 1
std::va_list 1
std::ostringstream 1
std::max 1
std::adopt_lock 1
std::memory_order_acquire 1
std::swap 1

三、应用
https://github.com/fffaraz/awesome-cpp

  • 日志库
  • 配置文件?
  • 读写redis
  • 读写mysql
  • http/rpc请求
  • pb/json/xml处理?

四、高级
GDB
出core后如何调试
内存泄露,cpu狂涨的原因追查

五、优秀的开源项目
sqlite
redis
nginx

六、其他
union,联合体?

make -j 8 #多线程编译

符号:
::
<<
->
&

.

标识符:
https://www.runoob.com/w3cnote/cpp-keyword-intro.html
auto,声明变量时根据初始化表达式自动推断该变量的类型、声明函数时函数返回值的占位符
static,在程序的生命周期内保持局部变量的存在,而不需要在每次它进入和离开作用域时进行创建和销毁
const_cast
dynamic_cast
static_cast
reinterpret_cast
delete
explicit
export
extern
friend
mutable
operator
register,用于定义存储在寄存器中而不是 RAM 中的局部变量
template
this
typedef #为一个已有的类型取一个新的名字
typeid
typename
union
virtual
volatile
wchar_t

三字符组, 不常见?

数据结构?

std::vector<uint64_t>
std::map<uint64_t, int>
std::unordered_map<uint64_t, int64_t>
std::pair<std::string, float>

std::max
std::rand()
std::shared_ptr

std::accumulate
boost::random::discrete_distribution<>
boost::random::mt19937 gen((unsigned int) std::time(NULL));
boost::split
boost::is_any_of(",")
boost::lexical_cast<uint64_t>
std::make_pair

函数参数:传值调用
指针调用
| 引用调用 |

c++指针
引用

三、常用类库
std::unordered_map
std::shared_ptr
std::string
c++ 使用pb?

多线程编程?
操作pb?

四、常见问题?
1.# error passing 'const' as 'this' argument

  1. 简单语法了解

  2. 常用类库

  3. virtual, 接口定义?Base的虚拟函数,子类可以重写虚拟函数。

  4. typedef,

类型转换:str 转int 等

相关文章

网友评论

      本文标题:C++

      本文链接:https://www.haomeiwen.com/subject/afivqqtx.html