袁辉勇 5=30 public protected private
1== private: int x; protected : int z;
#include <iostream>
using namespace std;
class test
{
private: int x;
public : int y;
protected : int z;
};
int main( )
{
test t;
cout << t.x<<endl;
cout << t.y<<endl;
cout << t.z<<endl;
}
C++ 文章被收录于专栏
C++谭浩强 冯博强 贾应知 袁辉勇