도저히 이해가 안가는 부분이 있어서...
struct list {
int no;
struct list *shortlink;
};
typedef struct list node;
node *head=NULL;
int deletenode(int rno)
{
node *current=head;
node *newnode=head;
node *temp;
if(current->no==rno)
{
newnode=current;
current=current->shortlink;
head=current;
return(1);
}
else
{
while(newnode->shortlink->shortlink!=NULL)
{
if(newnode->shortlink->no==rno)
temp=newnode->shortlink;
newnode->shortlink=newnode->shortlink->shortlink;
head=current;
return(1);
}
newnode=newnode->shortlink;
}
if(newnode->shortlink->shortlink==NULL && newnode->shortlink->no==rno)
newnode->shortlink=NULL;
head=current;
return(1);
}
else return(0);
}
}
여기서 newnode->shortlink->shortlink가 무슨 의미죠?--;
이중 구조체도 아닌데... 이런식의 표현은 너무 생소해서...
그리고 return(1), return(0)은 rno값으로 1이랑 0을 되돌린다는 뜻인가요?
그리고 전체적인 뭘하는 프로그램인지도 감이 안잡히네요..
부디 알려주시면 감사드리겠습니다.
많이 급하니 최대한 빠른 답변 부탁드립니다.(__)
|