摘要: 友元出现的目的是为了访问和更新 友元类的private 和 protect 信息:第一类: 类外的普通函数为友元类函数: 1 #include<iostream> 2 #include<string> 3 #include<stdio.h> 4 using namespace std; 5 class boy{ 6 public: 7 boy(string name,int age):name(name),age(age){} 8 ~boy(){} 9 //friend void get(boy& b);//要有参数1... 阅读全文
posted @ 2012-12-10 11:08 一把刷子 阅读(150) 评论(0) 推荐(0) 编辑