我的代码有问题吗? [英] Whats the problem with my code?

查看:55
本文介绍了我的代码有问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开 | 选择 | Wrap | 行号

解决方案

ronaldronald-


我可以得到它通过删除Persona ::,在gcc中减少两条错误消息在telefono.h(行:朋友类Persona :: Persona)中,但无法弄清楚Persona * persona的问题是什么;在那个班级。

展开 | 选择 | Wrap | 行号


看起来你与Persona命名空间发生了冲突,也是一个角色类。我怀疑编译器无法确定哪个是哪个。


将命名空间(或类)更改为其他内容,看看会发生什么。


< blockquote>谢谢,但真正的问题是键盘好友和使用命名空间。

另一个问题是:

展开 | 选择 | 换行 | 行号


Expand|Select|Wrap|Line Numbers

解决方案

ronaldronald-

I can get it down to two error messages in gcc by removing "Persona::" in the telefono.h (line: friend class Persona::Persona), but can''t figure out what the problem is with Persona *persona; in that class.

Expand|Select|Wrap|Line Numbers


It looks like you have a clash with a Persona namespace and also a Persona class. I suspect the compiler can''t figure out which is which.

Change the namespace (or class) to something else and see what happens.


thanks but the problem real is the keyboard friend and use namespace.
the other problem is:

Expand|Select|Wrap|Line Numbers


这篇关于我的代码有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆