错误C2040:间接问题的级别。 [英] error C2040: levels of indirection problem.
本文介绍了错误C2040:间接问题的级别。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在标题中定义了一个结构,如下所示:
Hi all,
I defined a struct in the header like this:
展开 | 选择 | 换行 | 行号
推荐答案
@DrSchwartz
这是你的编译器的神秘方式告诉你它认为mem_alloc( )返回一个int,你想将它转换为指向结构的指针。包含mem_alloc()函数的相应头文件。
亲切的问候,
Jos
@DrSchwartz
That''s your compiler''s cryptic way of telling you that it thinks that mem_alloc() returns an int and you want to cast it to pointer to a structure. Include the corresponding header file(s) for the mem_alloc() function.
kind regards,
Jos
>
@JOSAH
感谢您的回复。但是已经包含了mem_alloc()函数的标题。还有其他问题吗?
@JosAH
Thanks for reply. But the header of mem_alloc() function is already included. Can there be another problem?
@DrSchwartz
不要忽略那个(神秘的)错误诊断消息:编译器认为您要使用int作为结构指针。向我们展示mem_alloc()函数的声明或者更好,在你的违规行上方包含你自己的声明:
@DrSchwartz
Don''t ignore that (cryptic) error diagnostic message: the compiler thinks that you want to use an int as a struct pointer. Show us the declaration of that mem_alloc() function or better yet, include your own declaration just above that offending line:
展开 | 选择 | 换行 | 行号
这篇关于错误C2040:间接问题的级别。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文