My compiler tells me:Code:/* #include<stdio.h> struct msg{ char *p1; char *p2; char *p3; }mymsg; mymsg.p1="Teach yourself C in 21 days!"; mymsg.p2="By SAMS publishing."; int main(void) { printf("mymsg.p1 points to %s\n",mymsg.p1); printf("mymsg.p2 points to %s\n",mymsg.p2); /* p3 points to the same string p1 points to */ mymsg.p3=mymsg.p1; printf("mymsg.p3 points to the string p1 points to %s\n",mymsg.p3); /* p3 points to the same string p2 points to */ mymsg.p3=mymsg.p2; printf("mymsg.p3 points to the string p2 points to %s\n",mymsg.p3); return 0; } */
"stru_array3.c", line 9: warning: old-style declaration or incorrect type for: mymsg
"stru_array3.c", line 9: identifier redeclared: mymsg
current : int
previous: struct msg {pointer to char p1, pointer to char p1, pointer to char p2, pointer to char p3} : "stru_array3.c", line 7



LinkBack URL
About LinkBacks


