C++ Primer
bandaostart
这个作者很懒,什么都没留下…
展开
-
_stdcall与_cdecl区别
前段时间编程时遇到过这么一个问题,我写了一个DLL,把里面的一个函数导出来,然后再定义一个签名与其匹配的函数指针,动态地把这个DLL加载起来(LoadLibrary),得到函数指针后,一调用,结果报错了,错误如下:Run-Time Check Failure #0 - Th...转载 2020-03-11 16:17:27 · 219 阅读 · 0 评论 -
第7章:容器函数、lambad表达式
1,容器函数的使用、lambad表达式的使用2,源码#include <iostream>#include <algorithm>#include <iterator>#include <numeric>#include <vector>#include <list>#include <string>...原创 2019-04-19 09:05:28 · 275 阅读 · 0 评论 -
第12章:模板
1,模板的概念和使用2,源码#include <iostream>#include <vector>#include <stdio.h>#include <string.h>/*1,类型参数前必须使用关键字class或typename修饰,两者没有区别 template<typename T, class U> calc...原创 2019-04-22 08:50:05 · 91 阅读 · 0 评论 -
第11章:类面向对象理念
1,面向对象具体使用理念2,源码#include <iostream>#include <vector>#include <memory>/*1,基类: 通常在层次关系的根部有一个基类2,派生类:直接或间接从基类基础而来,这些继承得到的类称为派生类3,虚函数:对于某些函数,基类希望它的派生类各自定义适合自身的版本,此时基类就将这些函数声明成虚函...原创 2019-04-22 08:48:54 · 91 阅读 · 0 评论 -
第10章:类的设计
1,类的拷贝析构等函数的使用2,源码#include <iostream>#include <string>#include <vector>#include <algorithm>#include <memory>/*1,拷贝构造函数,拷贝赋值运算符,移动构造函数,移动赋值运算符,析构函数 拷贝和移动构造函数定义了...原创 2019-04-22 08:47:08 · 181 阅读 · 0 评论 -
第9章:智能指针
1,智能指针的使用2,源码#include <iostream>#include <memory>#include <list>#include <vector>/*1,智能指针smart_point:智能指针的行为类似常规指针,重要的区别是它负责自动释放所指向的对象shared_ptr:允许多个指针指向同一个对象unique_...原创 2019-04-22 08:44:54 · 90 阅读 · 0 评论 -
第8章:关联容器
1,关联容器的使用2,源码#include <iostream>#include <map>#include <unordered_map>#include <unordered_set>#include <set>#include <vector>#include <utility>/*关...原创 2019-04-22 08:42:56 · 96 阅读 · 0 评论 -
第6章:顺序容器及其它类型容器
1,顺序容器和操作2,源码#include <iostream>#include <string>#include <list>#include <vector>#include <forward_list>#include <deque>#include <array>/*顺序容器:1,v...原创 2019-04-17 09:20:22 · 114 阅读 · 0 评论 -
第5章:输入输出
1,输入输出(IO)2,源码#include <iostream>#include <string>/*1,输入输出模式分类头文件:iostream 标准输入输出包含:istream、wistream 从流读取数据;ostream、wostream 向流写入数据;iostream、wiostream 读写数据头文件:fstream 文件输入输出ifstre...原创 2019-04-17 09:16:54 · 99 阅读 · 0 评论 -
第4章:类
1,类的定义和使用2,源码#include <iostream>#include <string>/*1,public: 类的所有对象都可以调用public内声明的函数和变量2,private: 只能被类的成员函数调用,不能被类的对象调用3,友元函数: 声明后在函数内允许类对象调用使用私有变量4,类函数实现中::使用,作用域运算符来说明,我们定...原创 2019-04-16 08:50:53 · 97 阅读 · 0 评论 -
第3章:函数重载
1,函数重载2,源码#include <iostream>#include <vector>/*1,函数重载:如果作用域内几个函数的名字相同但是形参列表不同,我们称之为函数重载2,默认实参:我们可以为函数的多个形参定义默认值*/using namespace std;//函数重载void User_Print(const string name){...原创 2019-04-16 08:48:03 · 79 阅读 · 0 评论 -
第2章:string类型,vector使用
1,string类型和vector的使用2,源码#include<string>#include<iostream>using namespace std;int main(int argc, char *argv[]){ string str = ""; string str1(10 , 'H'); string str2 = "so...原创 2019-04-02 07:24:27 · 576 阅读 · 0 评论 -
第2章:常用数据类型说明,类静态数据
1,常用数据类型说明2,源码:#include <iostream>#include <QDebug>using namespace std;int main(int argc, char *argv[]){ unsigned int num1 = 20; int num2 = -40; cout << "Char ...原创 2019-04-02 07:22:18 · 250 阅读 · 0 评论 -
第1章:namespace的使用
1,namespace给类或者函数做一个区间定义2,源码:#include <iostream>//namespace : 给类或者函数做一个区间定义//using : 指定特定使用namespaceusing namespace std;namespace first_namespace{ void Test_Fun() { s...原创 2019-04-02 07:12:39 · 83 阅读 · 0 评论