/* Example7_6.cs illustrates some of the System.Object class methods*/ using System; class Example7_6{ class Program { static void Main(string[] args) { MyStruct st = new MyStruct(); st.X = 50; Console.WriteLine(st.X); Console.ReadLine(); } struct MyStruct { int intexmp; public int X { get { return intexmp; } set { if (value < 100) { intexmp = value; } } } } } }
C#结构体
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
结构体:修改默认对齐数、结构体传参——《初学C语言第45天》
修改默认对齐数、结构体传参
修改默认对齐数 结构体传参 -
结构体大小计算-结构体对齐
计算某一结构体大小:方法以及规则。
偏移量 #pragma 结构体 结构体大小计算 -
C# 调用C++结构体
参考网址:C#调用C/C++动态库,封装各种复杂结构体。_liguo9860的专栏-
结构体数组 Layout i++ -
c#结构体与类的区别
c#结构体与类的区别
基础 C# 知识