
C/C++
文章平均质量分 81
zyz394515661
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C/C++中多态性与虚函数
需要的先验知识:多态性的概念、在类继承中是否定义虚函数的例子 基类指针本来是用来指向基类对象的,当他用来指向派生类对象时。则会发生指针转换,将派生类对象的指针转换为基类对象的指针,所以此时基类指针指向的是派生类对象中基类的部分(故此时指针不能访问派生类特有的部分)。 重载与虚函数的差别:重载的“多态性”是发生在编译时的,根据调用函数的参数个数与参数类型决定到底调原创 2015-12-16 12:21:02 · 477 阅读 · 0 评论 -
C++学习小记
const int *p、 int const *p、 int *const p的区分,有种简单的记法:把定义从右往左读,把*都城“point to” const int *p 和 int const *p 读成:p is point to const int (指针指向常整型)原创 2017-01-18 10:47:42 · 270 阅读 · 0 评论 -
算法刷题心得:动态规划 scramble-string
牛客网在线编程:点击打开链接Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation ofs1 ="great":To scram原创 2017-12-02 18:50:23 · 1270 阅读 · 0 评论 -
POJ 1635 Subway tree systems
题目:Some major cities have subway systems in the form of a tree, i.e. between any pair of stations, there is one and only one way of going by subway. Moreover, most of these cities have a unique cent原创 2017-12-02 19:58:01 · 328 阅读 · 0 评论 -
C语言头文件相互包含的问题
头文件相互包含的问题问题:头文件交叉包含是否会导致递归包含,导致编译出错?如果不会因为递归包含出错,那么交叉包含是不是完全没问题?1.1 头文件交叉包含是否会导致递归包含,导致编译出错?(无#ifndef)假若头文件a包含了头文件b、头文件b又包含了头文件a,那么在#include头文件a的时候,就可能会导致递归包含,从而导致编译出错;/* a.h */#include "b...原创 2018-10-21 00:13:16 · 23627 阅读 · 2 评论