![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++进阶学习笔记
文章平均质量分 85
Dream_going
这个作者很懒,什么都没留下…
展开
-
c++类型转换详解
c++ 类型转换c++类型转换分为隐式类型转换和显式类型转换一,隐式类型转换又称为“标准转换”,包括以下几种情况:1,算术转换(Arithmetic conversion) : 在混合类型的算术表达式中, 最宽的数据类型成为目标转换类型。int ival = 3;double dval = 3.14159;ival + dval;//ival被提升为double类型2,一种类型表达式赋值给另一种原创 2016-10-09 14:41:20 · 783 阅读 · 0 评论 -
Effective C++ 学习笔记 00 概述
Effective C++ 0 导读术语(Terminology)1.声明式(declaration):告诉编译器某个东西的名称和类型。忽略其中的细节。extern int x; // object 声明式std::size_t numDigits(int number); // 函数(function)声明式class Widget; //类声明式template <typename T>原创 2016-09-21 15:12:37 · 380 阅读 · 0 评论 -
Effective C++ 学习笔记 01 const关键字
Effective c++ 01 习惯于c++1. c++是一个语言联邦多重范型编程语言(multiparadigm programming language)支持过程 (procedural)支持面向对象 (object-oriented)函数形式 (functional)泛型形式 (generic)元编程形式 (metaprogramming)2. 尽量使用const,enum,i原创 2016-09-26 01:42:13 · 375 阅读 · 0 评论 -
c++智能指针(smart pointer)详解
Smart Pointer Deal with c++11’s smart pointer facility.brief Smart pointers are class objects that behave like built-in pointers but also manage objects that you create with new so that you don’t原创 2017-02-17 14:59:27 · 5750 阅读 · 0 评论 -
c++ 对象模型与内存结构
c++ Object model object = data + algorithmData Layoutplain objectstruct foo{ int a,b,c;};12bytesalignmentstruct foo{ short a; int b; short c;};short 2bytesmemory alignment 12bytes原创 2017-03-21 18:50:26 · 411 阅读 · 0 评论 -
C++ 模版template
C++ Template模版类的继承和组合提供了对象代码复用的方法 Inheritance and composition provide a way to reuse object code. The template feature in C++ provides a way to reuse source code.template语法(Template syntax)templ原创 2017-03-29 12:33:33 · 379 阅读 · 0 评论 -
哈希表(hash)
C++ hash STL c++ hash_table 分析简介由索引到值的数据结构(data structure that maps keys to values)直接映射,需要很大的空间。空间的利用率不高,为了将某一元素映射到一个“大小可以接受之索引”,这样的函数为hash function(散列函数或者哈希函数)。通常的哈希函数为取模。哈希函数(hash function)h(ke原创 2017-03-29 12:34:37 · 323 阅读 · 0 评论 -
c++ 多态介绍
C++ 多态介绍 用c++ 虚函数机制实现的多态是继数据抽象(封装)和继承之后第三个重要的面向对象的特性向上转型(Upcast problem)//: C15:Instrument2.cpp// Inheritance & upcasting#include <iostream>using namespace std;enum note { middleC, Csharp, Eflat原创 2017-03-26 12:59:28 · 532 阅读 · 0 评论 -
C++ 多态机制实现
C++ 多态机制实现 compiler implement late binding mechanism迟绑定是如何实现的(How C++ implements late binding)关键字virtual告诉编译器不应该执行早期绑定,相反的,应该自动的安装所有必要的机制去执行迟绑定 ( The keyword virtual tells the compiler it should no原创 2017-03-26 16:09:48 · 1036 阅读 · 0 评论