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

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!portal!dfuller
  3. From: dfuller@portal.hq.videocart.com (Dave Fuller)
  4. Subject: Re: Someone help me with this
  5. Message-ID: <BxBMxG.42r@portal.hq.videocart.com>
  6. Organization: VideOcart Inc.
  7. X-Newsreader: Tin 1.1 PL3
  8. References: <1992Nov6.210507.2887@vela.acs.oakland.edu>
  9. Date: Sat, 7 Nov 1992 01:03:15 GMT
  10. Lines: 38
  11.  
  12. jmwojtal@vela.acs.oakland.edu (Wojo) writes:
  13. : I'm trying to do this program that goes into a void subroutine,
  14. : void getday(char *, int, char *);
  15. : ...
  16. : char fname[10];
  17. : int day;
  18. : char timetab[33][31];
  19. : getday(fname, day, timetab);
  20. : ...
  21. : void getday(char file[], int dy, char holdday[][]);
  22. : {
  23. : ...
  24. : }
  25. : Now it keeps giving me errors about different syntaxes.  
  26. : Using C for the PC, what is the corrent way to apply this so it will work?
  27. : The subroutine is supposed to get values for timetab only;
  28. -----------------------------------------------------------------
  29. chances are you get a null dimension error. what you need to do to clear
  30. this up without changing any of your data types is fairly simple.
  31. in getday make (char holdday[][]) this (char holdday[][31])
  32.  
  33. this should be all you need. it would be nice if you used #defines to 
  34. be sure about sizes staying in sync if 1 changes, but this is purely
  35. your choice.
  36.  
  37. you need a value in the second brace because of the way 2-d arrays are
  38. handled. with a value, the compiler can figure the offset between the 
  39. elements in the array.
  40.  
  41.  
  42. Dave Fuller
  43. dfuller@portal.hq.videocart.com
  44.  
  45.