![](https://img-blog.csdnimg.cn/20200609164446989.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
C/C++
C++
baby的我
社畜先生
展开
-
简易时间堆
Windows下的简易时间堆轮询。原创 2022-10-22 23:25:40 · 214 阅读 · 0 评论 -
C++虚函数
概念 虚函数是以virtual关键字声明的函数,如果在基类中将某个函数指定为virtual,并且派生类中有该函数的另外一个定义,那么编译器将会知道我们并不想静态链接改函数。我们需要的是基于调用该函数的对象的种类,在程序的特定位置选择调用哪一个函数。如:以下代码未用virtual:#include<bits/stdc++.h>using namespace std;class A{ public: void get() { fun(); } ...原创 2020-06-12 13:18:49 · 296 阅读 · 0 评论 -
C++继承访问级别
原创 2020-06-11 15:47:55 · 259 阅读 · 0 评论 -
C++技能树
来源于水印。转载 2020-01-02 22:31:49 · 491 阅读 · 0 评论 -
const位置的含义
int num = 1024;const int num2 = num1; //只能第一次赋值 num2 = 2048 // 报错const int * p = # //const 在 * 前面时,指针的位置可以修改,但不能通过指针修改指向的变量 int const * p = # //同上 int * const p = #//c...原创 2019-12-19 20:16:15 · 220 阅读 · 0 评论 -
结构体重载输入输出运算符
可以直接输入结构体,顺便初始化;#include<bits/stdc++.h>using namespace std;struct node{ int x, y, z; friend istream & operator >> (istream&, node &t) { cin >> t.x >> t...原创 2019-08-07 21:01:54 · 1899 阅读 · 0 评论 -
C++实现大数类
可以用int、char、string、Bint类型初始化支持各种运算符#include<bits/stdc++.h>#define MAXN 9999#define M 1000#define DLEN 4using namespace std;class Bint{ private: int a[M]; int len; public: Bi...原创 2019-05-26 20:15:51 · 1929 阅读 · 1 评论 -
C++中那些开挂的东西
1、万能头文件#include<bits/stdc++.h>这个头文件包含了所有的头文件,以后只需要打这一个头文件就ok啦,注意hdu上只有选择G++才可以用2、加速器ios::sync_with_stdio(false);加速cin和cout,这个可以加速到像scanf一样快,but省赛好像编译出错QAQ3、扩大栈内存#pragma comme...原创 2019-03-10 20:36:11 · 777 阅读 · 3 评论 -
复合类型
复合类型(compound type)是指基于其他类型定义的类型,C++中有几种复合类型,这里介绍引用和指针一、引用通俗的理解,引用就是为对象起了另外一个名字,引用类型引用(refer to)另外一种类型。通过将声明符写成&d的形式来定义引用类型,其中d是声明的变量名,引用在声明的时候必须被初始化int i=1024;int &d=i; //d指向i (d是i...原创 2019-04-21 21:53:55 · 508 阅读 · 0 评论