算术运算导致溢出.

编程入门 行业动态 更新时间:2024-10-10 05:27:32
本文介绍了算术运算导致溢出.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

public IDataEditState[] Children { get { if (m_ChildrenCache == null) { m_ChildrenCache = new IDataEditState[m_Children.Count - 1]; m_Children.Values.CopyTo(m_ChildrenCache, 0); } return m_ChildrenCache; } }

在上面的代码中,系统抛出了一个异常,原因是算术运算导致溢出." m_Children.Count即将为0. 请帮我....

In the above code one exception threw by system as "arithmetic operation resulted in an overflow." m_Children.Count is coming 0. please help me out ....

推荐答案

如果m_Children.Count为零,那么您正在尝试使用-1条目创建m_ChildrenCache数组,不会发生... if m_Children.Count is zero, then you''re trying to create your m_ChildrenCache array with -1 entries, which isn''t going to happen...

更多推荐

算术运算导致溢出.

本文发布于:2023-11-30 15:45:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1650558.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:算术

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!