数组作为结构字段 [英] array as struct field

查看:53
本文介绍了数组作为结构字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写具有poiner字段的结构或类似的结构:

i need to write structure which has a field of poiner to array or something like this:

展开 | 选择 | 换行 | 行号

推荐答案

错误,这有点令人困惑,但是,我想是这样的......假设您在MyClass中创建了适当的方法来返回该结构。仍然......如有疑问,请试一试! :)


我会说你在创建结构时需要初始化someArr,否则我相信它将是一个空引用。
Err, that''s a little confusing but yes, I think so... assuming you create the appropriate methods in MyClass to return that struct. Still... When in doubt, try it out! :)

I will say thought that you''ll need to initialize someArr when you create your struct, otherwise I believe it will be a null reference.


如果您希望能够从其他类访问它们,则需要公开项目。


您的示例代码中没有任何内容引用任何其他示例代码中的任何内容我可以看到。
You need to mak items public if you want to be able to access them from other classes.

None of your example code references anything in any other example code as far as I can see.
展开 | 选择 < span class =codeDivider> | Wrap | 行号


@tlhintoq


虽然它没有用,但我很欣赏你实际上快速反应并且乐于助人。另外 - 很好的幽默))))
@tlhintoq
Although, it didn''t work, i appreciate that you actually respond fast and being helpful. Also - great humor))))


这篇关于数组作为结构字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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