为什么无限循环在计数后停止(1993) [英] Why the infinite loop stops after the count(1993)

查看:114
本文介绍了为什么无限循环在计数后停止(1993)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

在我的代码中我使用一个无限循环而(true)

我有两种形式,即Form1和Form2。

Form1代码。

Hi guys
in my code i am using one infinite loop while(true)
and I have two forms i.e., Form1 and Form2.
Form1 Code.

private void Form1_Load(object sender, EventArgs e)
{
  int32 c=0;
  while (true)
  {
      Form2 fm = new Form2();
      fm.Show();
      c=c+1;
      if(c>1994)
      {
          MessageBox.Show(c.ToString());
      }      
  }
}





但是1993年之后循环突然停止,如果我工作正常使用form1 fm = new form1();

所以,有人可以告诉我它的原因吗?

先谢谢。



But loop suddenly stop after 1993 and it works fine if I uses form1 fm=new form1();
So, can anybody tell me the reason of it ?
Thanks In Advance.

推荐答案

好像是作业!在c大于1993之后循环不会停止,而是一个消息框开始出现,显示c的值并继续显示它直到你杀死应用程序。
Seems like homework! The loop does not stop after c greater than 1993 rather a message box starts appearing showing value of c and continue showing it till you kill the application.


代码在1993年之后也正常工作。 。(意思是我弹出消息框

喜欢:1995,1996 ......等等)

如果循环在你的机器停止那么它由于一些你创建1993年形式的内存问题..
The code was working fine after 1993 also..(means i m getting the message box pop up
like: 1995,1996 ...and so on)
If the loop stops in your machine then it due to some memory issue as you created 1993 form..


这篇关于为什么无限循环在计数后停止(1993)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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