- 博客(3)
- 资源 (8)
- 收藏
- 关注
转载 【C++】类中成员函数声明后面接 const
const 表示对类中成员函数属性的声明;表示不会修改类中的数据成员;在编写const成员函数时,若不慎修改了数据成员,或者调用了其他非const成员函数,编译器将指出错误;以下程序中,类stack的成员函数GetCount仅用于计数,从逻辑上讲GetCount应当为const函数。class Stack{ public: void Push(int elem)...
2018-07-30 16:24:07 4372
原创 【C++】C++成员函数后面跟冒号冒号
/* node class definition*/class Node{public: int data; // data Node *parent; Node *left; Node *right; public: // default Node( ) : data(-1), parent(NULL), left(NULL), right(NULL) { }; ...
2018-07-12 15:30:13 1854
原创 【C++】bool a:1;这个怎么解释?
Bit field, 位域。意思大概就是你虽然声明自己是个bool(8bit),但我可以只占1bit的空间。#include<iostream>using namespace std;struct S1{ bool b1 :1; bool b11 ;1; bool b111 :1; unsigned a :20; uns...
2018-07-03 11:36:02 2398
bleach-2.0.0-py2.py3-none-any.whl
2020-03-05
html5lib-0.999999999.tar.gz
2020-03-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人