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

Function returning a struct

Hi,
How come the 51 compiler V7.04 cannot compile the following code?

typedef struct {
int i;
} S;

S jj(void) {
S k;

return(k);
}

S i(void) {
return(jj());
}

void main(void) {
}

The compiler gives "illegal type conversion error" in the line "return(jj());"

Andy