标题:[求助]这里的this是什么意思?
取消只看楼主
norlan
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2007-5-3
 问题点数:0 回复次数:1 
[求助]这里的this是什么意思?
#include<iostream.h>
class pair
{
char c1,c2;
public:
void set(char b)
{c1=1+(c2=b);}
unsigned where_am_I()
{ return ((unsigned)this); }//什么意思?
void print()
{cout<<c1<<"+"<<c2<<"\t";}
};
void main()
{
pair a,b,c;
a.set('A');
b.set('b');
c.set('c');
a.print();
cout<<"is at"<<a.where_am_I()<<'\n';
b.print();
cout<<"is at"<<b.where_am_I()<<'\n';
c.print();
cout<<"is at"<<c.where_am_I()<<'\n';
}
搜索更多相关主题的帖子: 什么意思 color 
2007-05-20 23:16
norlan
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2007-5-3
得分:0 
似乎明白了,谢谢~~
2007-05-21 09:10



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




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

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