加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 如何使用引用导致编译时错误或运行时错误?

发布时间:2020-12-16 07:06:55 所属栏目:百科 来源:网络整理
导读:我无法找到一个问题的解决方案,我的朋友在面试中被问到…以下是问题: Define a class such that declaring/using a reference to its object will give a. compile time error b. run time error Generally,a reference would be of type class X = Y; 我们
我无法找到一个问题的解决方案,我的朋友在面试中被问到…以下是问题:

Define a class such that declaring/using a reference to its object will give
a. compile time error
b. run time error

Generally,a reference would be of type <class> &X = Y;

我们如何实现上述内容以及定义引用时内部发生的事情?请有人请注意一下.

解决方法

没有类的实例不能绑定它们的引用.

至于“使用”,这太模糊了,无法回答.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读