home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16211 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.5 KB  |  52 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!gumby!destroyer!wsu-cs!vela!jmwojtal
  3. From: jmwojtal@vela.acs.oakland.edu (Wojo)
  4. Subject: Stack overflow problems
  5. Message-ID: <1992Nov9.153526.22728@vela.acs.oakland.edu>
  6. Organization: Oakland University, Rochester MI.
  7. Date: Mon, 9 Nov 1992 15:35:26 GMT
  8. Lines: 42
  9.  
  10. First of all, thank you for your responses about double arrays.  Now I have
  11. another problem, I'm storing too much data in my program.
  12.  
  13. I identified the main culprits:
  14.  
  15. struct key {
  16.   char *word;
  17.   char pos;
  18. } keytab[] = {
  19.      "0101", 1,
  20.       .....
  21.      "1302", 33};
  22.  
  23. struct today {
  24.   char count;
  25.   char maxt;
  26. } timenow[33][31];
  27.  
  28. char timetab[33][24];
  29.  
  30. the 33 is the number of keytabs (I use a constant NKEYS in my program)
  31. the 31 is the maximum number of days in a month
  32. the 24 is the hours in a day;
  33.  
  34. The program reads in files for a given month.  All files have one day of
  35. information about information about "0101" thru "1302".  There are between
  36. 1 to 15 lines of information an hour.
  37.  
  38. I believe I have a logrithm to do it, but when I run it, garbage comes out of
  39. it, with different values of keytab even though I don't change them.  
  40.  
  41. Is there any way to eliminate the space problem without doing any major changes
  42. to the program?
  43.  
  44. Thank You
  45.  
  46.  
  47. -- 
  48. ************************************************************************
  49. Jeff Wojtalewicz (Wojo)  jmwojtal@vela.acs.oakland.edu
  50. Oakland University              Start Hacking
  51. ************************************************************************
  52.