Re: how to passing cofunc as parameter to another function
"Mircea" <[email protected]>
| Newsgroups | gmane.comp.hardware.rabbit-semiconductor |
|---|---|
| Message-ID | <[email protected]> |
In addition to what hongyang74 said, the code of your cofunction doesn't make much sense. Maybe it is a stripped down version of the real code. Otherwise there is no point in making a cofunction that doesn't include one of waitfor, abort, yield or wfd constructs. --- In [email protected], "dynamic_c@..." <dynamic_c@...> wrote: > > Anyone can help me, I get error when passing cofunc as parameter to another function. My code as follows: > > cofunc char *getMonth(int num){ > static char *const months[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; > if(num>=1 && num<=12) return months[num-1]; > } > > void main() { > char buffer[15]; > > costate { > memset(buffer, '\0', sizeof(buffer)); > memcpy(buffer, wfd getMonth(1), sizeof(buffer)); // error in here > printf("Month: %s", buffer); > } > } >