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

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!destroyer!cs.ubc.ca!news.UVic.CA!ugly!aramsey
  3. From: aramsey@ugly.UVic.CA (Aaron  Ramsey)
  4. Subject: What is wrong with this very simple c program?
  5. Message-ID: <1992Nov10.184406.25907@sol.UVic.CA>
  6. Summary: help????? 
  7. Sender: news@sol.UVic.CA
  8. Nntp-Posting-Host: ugl-gw.uvic.ca
  9. Organization: University of Victoria, Victoria, BC, Canada
  10. Date: Tue, 10 Nov 92 18:44:06 GMT
  11. Lines: 34
  12.  
  13. I wrote this as part of a larger program, and it keeps locking up my machine.
  14. When I run it, it prints "started....done...." then my machine either locks
  15. up, or a requestor comes up asking me to either suspend or reboot. The
  16. guru error on this is 81000004. I can't figure out why such a simple program
  17. should be doing this. I tried setting my stack very very high to see if
  18. that made any difference (stack 200000) but it still did the same. If I use
  19. the ordinary stack size (whatever that might be... around 2000 I guess)
  20. the program terminates with a stack overflow error, but doesn't lock up
  21. my machine. I have a vxl-30, and have tried compiling it under both 030
  22. and normal 000 code, but it makes no difference....  Does anybody have
  23. a clue? I've only been programming in C for a week or two, and I can't
  24. spot any obvious problems... 8-(
  25.  
  26. Here is the code.
  27.  
  28. #include <stdio.h>
  29.  
  30. main()
  31. {
  32.    int zoop[1000];
  33.       int counter;
  34.      
  35.         printf ("started....");
  36.            for (counter = 0; counter < 5000; counter += 5) {
  37.              zoop[counter] = counter;
  38.             }
  39.                printf("done....");
  40.                }
  41.  
  42.  
  43.                Well... I hope somebody can see my mistake....
  44.  
  45.                -Aaron  
  46.  
  47.