Passing Multi-dimensional arrays to a function

Christopher R Volpe volpe at underdog.crd.ge.com
Wed Jul 18 22:46:35 AEST 1990


In article <1990Jul17.224910.20086 at DRD.Com>, tdh at DRD.Com (Tom Haynes) writes:
>    int ared2bf(struct st_edit **, int, char ***, int *, int *);
>    int cischa(int, char *, int, int, char **);
>    char buf[SCREEN][COLS][MAX_SCREEN];
>    char prefix[6][KEYS];
>    int  curr;
>    curr = 0;
> 	:
> 	:
>    cischa(pnlptr, "PREFIX", 0, SCREEN, prefix[curr]);
*                                         ^^^^^^^^^^^^
*
*         prefix[curr] is of type (char *) whereas the formal parameter
*         is of type (char **). Maybe you wanted "&prefix[curr]"???
*
>    ared2bf9EDIT, curr, buf, free, list);

> ardrvr.c(63) : warning C4047: 'arguement' : different levels
> 	of indirection
*
*You haven't shown the reference to 'arguement'
*
> ardrvr.c(63) : warning C4024: 'cischa' : different types :
> 	parameter 5
*
* The is the one I pointed out above (prefix[curr]).
*                         
> ardrvr.c(64) : warning C4047: 'arguement' : different levels
> 	of indirection
> ardrvr.c(64) : warning C4024: 'ared2bf' : different types :
> 	parameter 3
*
*Beats me, buf is of type (char ***), and that's what the formal parameter
*wants.
*

Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.lang.c mailing list