home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcom.com!fletcher
- From: fletcher@netcom.com (F. Sullivan Segal)
- Subject: Re: What is wrong with this very simple c program?
- Message-ID: <1992Nov11.201038.16048@netcom.com>
- Organization: bottom up!
- References: <1992Nov10.184406.25907@sol.UVic.CA>
- Date: Wed, 11 Nov 1992 20:10:38 GMT
- Lines: 48
-
- In article <1992Nov10.184406.25907@sol.UVic.CA> aramsey@ugly.UVic.CA (Aaron Ramsey) writes:
- >guru error on this is 81000004. I can't figure out why such a simple program
- >should be doing this. I tried setting my stack very very high to see if
- >that made any difference (stack 200000) but it still did the same. If I use
- >Here is the code.
- >
- >#include <stdio.h>
- >
- >main()
- >{
- > int zoop[1000];
- # define ZOOPMAX 1000
- # define ZOOPINC 5
- int zoop[ZOOPMAX];
- > int counter;
- >
- > printf ("started....");
- > for (counter = 0; counter < 5000; counter += 5) {
- for (counter = 0; counter < ZOOPMAX*ZOOPINC; counter += ZOOPINC)
- {
- > zoop[counter] = counter;
- zoop[counter/ZOOPINC] = counter;
- > }
- > printf("done....");
- > }
- >
- >
- > Well... I hope somebody can see my mistake....
- >
- > -Aaron
- >
-
- All C arrays are indexed by ones, beginning at zero. To access by fives,
- divide down to ones.
-
- P.S.
- Really ugly indentation style.
-
- --
- -F. Sullivan Segal
- _______________________________________________________________
- _
- /V\ E-Credibility: (n -- ME) The unguaranteed likelyhood that
- ' the electronic mail you are reading is genuine rather than
- someone's made up crap.
- _______________________________________________________________
- Mail to: fletcher@netcom.com
-
-