struct student {
int number;
char name[10];
double height;
struct student *next;
};
int main(void)
{
struct student s1 = { 30, "Kim", 167.2, NULL };
struct student s2 = { 31, "Park", 179.1, NULL };
struct student *first = NULL;
struct student *current = NULL;
first = &s1;
s1.next = &s2;
s2.next = NULL;
current = first;
while( current != NULL )
{
printf(“SID=%d Name=%s, Height=%f\n", current->number, current->name, current->height);
current = current->next;
}
}
설명좀해주세요 ㅠㅠ
first는 s1을 가리키고 s1.next는 s2를 가리키고 s2.next는 0이고 current는 first를 가리키는거 아닌가요?