delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/16/23:57:15

From: "Brian Mccabe" <bmccabe1 AT home DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <7adai7$ji5 AT journal DOT concentric DOT net>
Subject: Re: Problem with Stack Overflow
Lines: 21
X-Newsreader: Microsoft Outlook Express 4.72.3155.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
Message-ID: <2Ary2.4012$rv2.2151@news.rdc1.ct.home.com>
Date: Wed, 17 Feb 1999 04:28:46 GMT
NNTP-Posting-Host: 24.228.19.78
X-Complaints-To: abuse AT home DOT net
X-Trace: news.rdc1.ct.home.com 919225726 24.228.19.78 (Tue, 16 Feb 1999 20:28:46 PDT)
NNTP-Posting-Date: Tue, 16 Feb 1999 20:28:46 PDT
Organization: @Home Network
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

((I'm having a problem with a Stack Overflow ( General Protection Error) . I
Symifyed my program and was told that my errors were }s. I checked over my
code and found out that all my problems were related to one function.))

((void unequip_other_weapons(void) {
  int x;
  for(x=0;x<sizeof(PS.weapons_array); x++) {
    if(PS.weapons_array[x] == 2) { PS.weapons_array[x] = 1; }
  }
}))

write now u r getting the size of the array in bytes, if u want it in
elements u change line 3 to this

for(x=0;(sizeof(PS.wepons_array/PS.wepons_array[0]);x++)





- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019