c언어 구조체
가지등
2023.04.01
질문 제목 : c언어 구조체제가 struct point pos1, pos2; 이거 부터 쭉 내용이 이해가 가지 않습니다.
알려주세요질문 내용 : #include stdio.h
#include math.h
struct point
{
int xpos;
int ypos;
};
int main(void)
{
struct point pos1, pos2;// 여기서 부터 이해가 안갑니다.
double distance;
fputs(point1 pos: , stdout);
scanf(%d %d, &pos2.xpos-&pos2.ypos);
double distance;
fputs(point1pos: , stdout);
scanf(%d %d, &pos1.xpos, &pos1.ypos);
fputs(point2pos: , stdout);
scanf(%d %d, &pos2.xpos, &pos2.ypos);
distance=sqrt((double)((pos1.xpos-pos2.xpos)*(pos1.xpos-pos2.xpos)+
(pos1.ypos-pos2.ypos)*(pos1.ypos-pos2.ypos)));
printf(두 점의 거리는 %g입니다. \n, distance);
return 0;
}