Or, skip the middleman altogether.
Code:
int main(void)
{
LINE myline;
printf("Please give me the x coordinate of beg: ");
scanf("%d", &myline.beg.x);
printf("Please give me the y coordinate of beg: ");
scanf("%d", &myline.beg.y);
printf("Please give me the x coordinate of end: ");
scanf("%d", &myline.end.x);
printf("Please give me the y coordinate of end: ");
scanf("%d", &myline.end.y);
printf("myline: beg(%d,%d), end(%d,%d)\n",
myline.beg.x, myline.beg.y, myline.end.x, myline.end.y);
return 0;
}
[edit]
But if you must, why not just copy structures?
Code:
int main(void)
{
POINT p1, p2;
LINE myline;
printf("Please give me the x coordinate of p1: ");
scanf("%d", &p1.x);
printf("Please give me the y coordinate of p1: ");
scanf("%d", &p1.y);
printf("Please give me the x coordinate of p2: ");
scanf("%d", &p2.x);
printf("Please give me the y coordinate of p2: ");
scanf("%d", &p2.y);
myline.beg = p1;
myline.end = p2;
printf("myline: beg(%d,%d), end(%d,%d)\n",
myline.beg.x, myline.beg.y, myline.end.x, myline.end.y);
return 0;
}
[/edit]