MESSAGE
DATE | 2004-09-09 |
FROM | Billy
|
SUBJECT | Re: [hangout] Re: two dimensional arrays passed to functions
|
On Thu, Sep 09, 2004 at 12:19:29PM -0400, Ruben wrote: > > [This is an email copy of a Usenet post to "comp.lang.c"] > > On Thu, 09 Sep 2004 00:42:57 -0400, Ruben wrote: > > > out of deperation because when I defined it as > > > > char * insert(char table[255],int cols, char values) > > I keep getting no data passed.
NO data?
> Actually, I originally defined this function as > char * insert(char table[255],int cols, char **values)
> Everything I'm reading seems to say I have to define this > as > char * insert(char table[255],int cols, char values[][256])
Don't pass arrays, doing so is just begging for bugs.
The right way to do it:
char * insert(char *table, int cols, char **values);
> but main can be defined as int main (int argv, char **argc) without any > problem.
Actually, it's:
int main (int argc, char **argv);
And you'll note that argc is needed to tell you how many elements are in argv.
> This is driving me crazy because I could sware I did this on SCO > compilers about 8 years ago without any trouble.
Well, you didn't.
Advice: don't use arrays as arguments. It's stupid. Use pointers.
____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|