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