C#中的结构 [英] Structs in C#

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

问题描述

我有一个Temp结构的结构对象。

I have one structure object of Temp strucure.

展开 | 选择 | Wrap | 行号

推荐答案

开始通过远离旧式结构和arraylists。

您可以使用类来代替结构。在未来,您的课程可以获得更高端的功能,例如将运行的方法。如果它从未变得那么聪明,那就没关系,只需将它用于数据。

Start by getting away from old style structs and arraylists.
You can use a class in place of a struct. In the future your class can gain higher-end capabilities such as methods that will run. If it never grows that smart, that''s fine, just use it for the data.

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


提示:在编写问题时,工具栏上有一个按钮,用于包装复制/粘贴代码周围的[code]标记。它有助于一堆。它的按钮上有一个''#''。 有关标签的更多信息。他们很酷。 Check''em出来。
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a ''#'' on it. More on tags. They''re cool. Check''em out.


感谢您的回复..但我想在基类中使用struct..thats。

我可以不要修改它。你能否告诉我是否可以选择使用它?
Thanks for your reply.. but I want to use struct..thats in base class.
I can not modify it. Could you please tell me if there is an option to use this?


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

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