uacs2024

导航

c++在类外是不能直接调用私有成员函数的

c++在类外是不能直接调用私有成员函数的,比如 #include <iostream> using namespace std; class A3 { void show3() { cout << "class A3"<< endl; //注意,类内部默认是私有 } }; int main() {

posted on 2024-03-04 21:18  ????  阅读(47)  评论(0编辑  收藏  举报