#include<iostream>
using namespace std;
class student {
//公共权限 成员类内可以访问 类外可以访问
public:
string m_Name;
//保护权限 成员类内可以访问 类外不可以访问
protected:
string m_Car;
//私有权限 成员类内可以访问 类外不可以访问
private:
int m_Password;
public:
void func() {
m_Name = "王二蛋";
m_Car = "雅迪";
m_Password = 123456;
}
};
int main(){
student s1;
s1.m_Name = "杨某";
//s1.Password不可访问
//s1.m_Car不可访问
s1.func();
system("pause");
return 0;
}