易码技术论坛

 找回密码
 加入易码
搜索
查看: 275662|回复: 6

[HeLP,HeLp!]帮我看看那里出错?LaveIDE上没问题啊,就是死机?

[复制链接]
发表于 2006-3-10 13:04:00 | 显示全部楼层
mod=m-(m/i)*i;

有错!当i=0时会发生除0错
发表于 2006-3-10 21:56:00 | 显示全部楼层
厉害啊,我顶!
 楼主| 发表于 2006-3-11 07:15:00 | 显示全部楼层
thanks,我改一下看看.[em01]
发表于 2007-9-10 21:40:00 | 显示全部楼层
好像我也遇到了,
什么原因
发表于 2007-9-11 18:18:01 | 显示全部楼层
TextOut(x1,y1,"1",type);
gvm1.0 即 LavaX1.0 的解释器对临时字符串(如 "1" ) 的处理并不完善,多次使用临时变量的时候很可能会溢出缓冲区(缓冲区一般只有1024字节),所以,把TextOut中的 临时字符串 先定义为数组再使用看看。
 楼主| 发表于 2006-3-8 21:49:34 | 显示全部楼层 |阅读模式
void numOut(int x,int y,int n,int type)
{
  int m,x1,y1,mod,charLong;
  long i;
  m=n;
  x1=x;
  y1=y;
  i=1000000000;
  if (type-128>=0) charLong=3;
    else charLong=5;
  if (m<0)
    {
      TextOut(x1,y1,"-",type);
      x1=x1+charLong;
      m=0-m;
    }
  do
  {
    mod=m-(m/i)*i;
    i=i/10;
    if (mod==1) TextOut(x1,y1,"1",type);
    if (mod==2) TextOut(x1,y1,"2",type);
    if (mod==3) TextOut(x1,y1,"3",type);
    if (mod==4) TextOut(x1,y1,"4",type);
    if (mod==5) TextOut(x1,y1,"5",type);
    if (mod==6) TextOut(x1,y1,"6",type);
    if (mod==7) TextOut(x1,y1,"7",type);
    if (mod==8) TextOut(x1,y1,"8",type);
    if (mod==9) TextOut(x1,y1,"9",type);
    if (mod!=0) x1=x1+charLong;
  }
  while (m!=0)
}

long iBoxNum()
{
  int iBoxNum_Key;
  ClearScreen();
  Refresh();
  do
  {
    Rectangle(40,33,120,47,1);
    Rectangle(38,31,122,49,1);
    TextOut(40,33,"大字体",0x81);
    iBoxNum_Key=getchar();   
  }
  while (iBoxNum_Key!=13);
}

void main()
{
  int a;
  long c;
  a=11111;
  c=100000;
  a=a%c;
  printf("%d",a);
  numOut(1,1,a,64);
  a=getchar();
}

在LavaIDE Ver0.9上通过
模拟时出错"gvmakerstar.exe 遇到问题需要关闭。我们对此引起的不便表示抱歉。"
WQXNc3K上,直接死机?
发表于 2008-1-1 17:40:28 | 显示全部楼层
连我都看不懂.......................................
您需要登录后才可以回帖 登录 | 加入易码

本版积分规则

Archiver|手机版|小黑屋|EMAX Studio

GMT+8, 2024-4-25 08:00 , Processed in 0.014548 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表