이해가 가지 않는것이 있어 질문합니다.
달콤이
2023.04.01
질문 제목 : 이해가 가지 않는것이 있어 질문합니다.질문 요약 :comp.human.name에서 왜 Lee가 나오는지 이해가 잘가지 않습니다.
//로 표시된곳을 설명 해주시면 감사하겟습니다.질문 내용 :
#includestdio.h
#includeconio.h
struct student{
char name[20];
char* next;
} stu = {BumJong lee,soo Han};
struct company{
char companyName[20];
struct student human;
int salary;
} comp = {Korea,Lee,Han,3000};
int main(void)
{
printf(%s\n,comp.companyName);//
printf(%s\n,comp.human.name);//
printf(%c\n,stu.name[1]);//
printf(%d\n,comp.salary);//
getch();
return 0;
}
-
사람
int arr[2][3] = { {1, 2, 3}, {4, 5, 6}};
위와 같이 초기화할 수 있지만
int arr[2][3] = { 1, 2, 3, 4, 5, 6};
이렇게 초기화할 수도 있습니다.
struct company 변수를 {\Korea\ -
보미
\Lee\
-
WatchOut
잘 나오는데요~ 머가 문제죠?