
C++语言
m筱米
这个作者很懒,什么都没留下…
展开
-
C++派生类访问权限
C++类继承访问权限: 一、派生类对象 1.public继承: 派生类对象无权限访问基类private成员; 派生类对象无权限访问基类protected成员; 派生类对象有权限访问基类public成员。 2.protected/private继承: 派生类对象无权限访问基类任何成员。 二、派生类成员函数 1.public继承: 派生类成员函数无权限访问基类private成员;原创 2013-08-12 14:20:12 · 1446 阅读 · 0 评论 -
C++操作符重载
整理部分C++操作符重载,直接上代码: myOperator.h #pragma once #include using namespace std; class myOperator { public: myOperator():x(0),y(0){ a[0] = a[1] = 0; } friend ostream& operator<<(ostream& os, con原创 2013-12-11 10:36:29 · 630 阅读 · 0 评论 -
顺序栈实现
#define MAXSIZE 100 typedef struct { char elem[MAXSIZE]; int top; }stStack; void InitStack(stStack*& s); int Push(stStack*& s, char e); char Pop(stStack*& s); int _tmain(int argc, _TCHAR* argv[])原创 2013-12-26 09:50:38 · 755 阅读 · 0 评论