home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / amiga / programm / 15709 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.8 KB  |  59 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. 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
  3. From: fletcher@netcom.com (F. Sullivan Segal)
  4. Subject: Re: What is wrong with this very simple c program?
  5. Message-ID: <1992Nov11.201038.16048@netcom.com>
  6. Organization:  bottom up!
  7. References: <1992Nov10.184406.25907@sol.UVic.CA>
  8. Date: Wed, 11 Nov 1992 20:10:38 GMT
  9. Lines: 48
  10.  
  11. In article <1992Nov10.184406.25907@sol.UVic.CA> aramsey@ugly.UVic.CA (Aaron  Ramsey) writes:
  12. >guru error on this is 81000004. I can't figure out why such a simple program
  13. >should be doing this. I tried setting my stack very very high to see if
  14. >that made any difference (stack 200000) but it still did the same. If I use
  15. >Here is the code.
  16. >
  17. >#include <stdio.h>
  18. >
  19. >main()
  20. >{
  21. >   int zoop[1000];
  22. #   define ZOOPMAX 1000
  23. #   define ZOOPINC 5
  24.     int zoop[ZOOPMAX];
  25. >      int counter;
  26. >     
  27. >        printf ("started....");
  28. >           for (counter = 0; counter < 5000; counter += 5) {
  29.            for (counter = 0; counter < ZOOPMAX*ZOOPINC; counter += ZOOPINC) 
  30.            {
  31. >             zoop[counter] = counter;
  32.              zoop[counter/ZOOPINC] = counter;
  33. >            }
  34. >               printf("done....");
  35. >               }
  36. >
  37. >
  38. >               Well... I hope somebody can see my mistake....
  39. >
  40. >               -Aaron  
  41. >
  42.  
  43. All C arrays are indexed by ones, beginning at zero.  To access by fives,
  44. divide down to ones.
  45.  
  46. P.S.  
  47.     Really ugly indentation style. 
  48.  
  49. --
  50.                            -F. Sullivan Segal
  51. _______________________________________________________________
  52.  _
  53. /V\  E-Credibility:  (n -- ME) The unguaranteed likelyhood that
  54.  '   the electronic mail you are reading is genuine rather than
  55. someone's made up crap.
  56. _______________________________________________________________
  57. Mail to: fletcher@netcom.com
  58.  
  59.