【求助】关于重载运算符
  • 板块学术版
  • 楼主Boeing
  • 当前回复10
  • 已保存回复10
  • 发布时间2020/11/17 21:56
  • 上次更新2023/11/5 07:48:50
查看原帖
【求助】关于重载运算符
222757
Boeing楼主2020/11/17 21:56

大佬们,为什么在考场上无法编译呢?在我的电脑上就可以编译。

struct poi{
	int v,num;
	friend operator <(poi x,poi y)
	{
		return(x.v<y.v);
	}
}

以及friend的用法。 还有const加不加有影响吗

friend operator <(const poi x,const poi y)

还有这个取地址

friend operator <(const poi &x,const poi &y)
2020/11/17 21:56
加载中...