2006年12月20日

摘要: 1.访问控制:public, private, protected2.友元:struct X{private: int i;friend void g(X*, int); //Global friendfriend void Y::f(X*);// Struct member friendfriend structZ; //Entire struct};void g(X* x, int i){ x->i=i;}3.不完全的类型声明。时刻想着编译器怎么处理程序的。例如Y::f() 就只能用指针引用。struct X;struct Y{ void f(X*);};struct X {priv 阅读全文

posted @ 2006-12-20 16:21 Teddy Yan 阅读(103) 评论(0) 推荐(0) 编辑


Copyright © 2024 Teddy Yan
Powered by .NET 8.0 on Kubernetes