This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

why a pointer to struct cause a sytax err:(

gentlemen,thing is as following:
in Cmnd.c file, a struct is defined:
typedef struct {
unsigned char arg1;
unsigned char arg2;
unsigned char arg3;
unsigned int arg4;
unsigned int arg5;
}para;
and then three para type variables:
para data Strt1,Strt2,Strt3;

and I have 2 place where the para type variables are accessed.
in Reset.c file,three routines:
ResetParse(para data*data StructPtr);
ColdReset(para data*data StructPtr);
HotReset(para data*data StructPtr);
compile,pass.
but in another file Cmnd.c where the para is defined. It just doesnt work:(
the routine
ExeCmnd(uint len,uchar xdata*data Cmnd,para data*data StructPtr);
compile,an err occurs;(
CMND.C(24): error C141: syntax error near 'data', expected ')'
and if I change it to this:
ExeCmnd(uint len,uchar xdata*data Cmnd,uchar data*data StuctPtr);
compile,done!
faint,anybody help me,and tell me what's going on:(
I thought it was probably coz there are too many parameters than 3 parameters that couldb be passed thru registers,but I change parameters number,not yet work:(,
then I come here for help,
the basic project setup is:
mcu: Ram 256,
large mode,
and nothing special;
thanks in advance:)
---going to mad:(

0