You can't make assignments to the structure members in global scope. Initialization is allowed though:
Code:
#include<stdio.h>
struct msg{
char *p1;
char *p2;
char *p3;
}mymsg = {
"Teach yourself C in 21 days!",
"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;
}