子类无权访问父类的私有数据成员
来源:互联网 发布:如何获取ims药品数据库 编辑:程序博客网 时间:2024/04/29 14:26
// 111.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include<iostream>class person {int age;public:void SetAge(int nAge){age = nAge;}int GetAge(){return age;}};class student : public person{public:void display(){using namespace std;cout<<person::GetAge();}void SetAge(int nAge){//age = nAge; //error}};int main(int argc, char* argv[]){student stu;stu.person::SetAge(25);stu.display();return 0;}
- 子类无权访问父类的私有数据成员
- Android,子类访问父类私有成员
- 子类能否继承、访问父类的私有成员
- 子类继承父类的私有成员
- 类的私有数据成员的访问
- 子类能不能继承父类的私有成员
- java中子类能不能继承父类的私有成员
- 访问类的私有成员
- 访问类的私有成员
- 类中私有数据成员的可访问性
- 友函数访问类的私有数据成员
- 子类用反射可以访问父类中的私有成员变量及方法
- C++从子类访问父类的私有函数
- C++从子类访问父类的私有函数
- 从子类访问父类的私有函数
- C++:从子类访问父类的私有函数
- 关于Java子类访问父类的私有变量
- JAVA在子类中访问父类的私有属性
- Deployment Instruction for Freescale MPC8313ERDB Board
- SSH原理与运用(二):远程操作与端口转发
- Web Service概述
- 跟我一起写Makefile【三】
- 求1/3-3/5+5/7+....+19/21
- 子类无权访问父类的私有数据成员
- 项目软件编写规范
- 基于FPGA的图像处理(二)--System Generator入门
- js获取当前时间
- 两分钟彻底让你明白Android Activity生命周期(图文)
- 项目开发文档
- nyoj27 水池数目 dfs
- 音视频压缩
- Windows核心编程——第一章