Why is the following code illegal?
typedef struct{ char a[6]; } point; int main() { point p; p.a = \"onetwo\"; }
Does it have any
No strcpy or C99 compund literal is needed. The example in pure ANSI C:
typedef struct{ char a[6]; } point; int main() { point p; *(point*)p.a = *(point*)"onetwo"; fwrite(p.a,6,1,stdout);fflush(stdout); return 0; }