标题:为什么友员函数报错不能访问私有成员???
只看楼主
yuyunliuhen
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:1435
专家分:0
注 册:2005-12-12
得分:0 
还是用VC++2005,或DEV C++吧

Go confidently in the  directions of your dreams,live the life you have imagined!Just do it!
It is no use learning without thinking!
2007-04-21 22:05
wfpb
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2188
专家分:0
注 册:2006-4-2
得分:0 
我这里就是在官方下载的sp6,但是不知道怎么给你们

[glow=255,red,2]wfpb的部落格[/glow] 学习成为生活的重要组成部分!
2007-04-21 22:30
aipb2007
Rank: 8Rank: 8
来 自:CQU
等 级:贵宾
威 望:40
帖 子:2879
专家分:7
注 册:2007-3-18
得分:0 
以下是引用wfpb在2007-4-21 22:30:51的发言:
我这里就是在官方下载的sp6,但是不知道怎么给你们

给个地址就OK了!


Fight  to win  or  die...
2007-04-21 22:53
weishj
Rank: 1
等 级:新手上路
威 望:2
帖 子:141
专家分:0
注 册:2007-4-22
得分:0 

VC++6.0下,只有用形如#include <iostream.h>的形式包含头文件并且去掉using namespace std;这一句后友元函数才能访问私有成员,这据说是VC++6.0的一个BUG,但具体还不能确定.


If you shed tears when you miss the sun, you also miss the stars.
2007-04-23 19:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-133743-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.095329 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved