这里有什么问题?它打印第一个 printf 但它不打印下一条语句 帮助赞赏。
代码:
#include<stdio.h>
#include<stdlib.h>
struct node
{
int Data;
struct node *Link;
};
//close struct
void insertAtEnd(struct node *Itcstd, int iData)
{
while (Itcstd->Link != NULL )
Itcstd = Itcstd->Link;
Itcstd->Link = (struct node*) malloc(sizeof(struct node));
Itcstd->Link->Link = NULL;
Itcstd->Link->Data = iData;
} //close insertAtEnd
int main()
{
struct node *EHead;
EHead = (struct node*) malloc(sizeof(struct node));
EHead->Link = NULL;
EHead->Data = 4;
printf("EHead link: %p Ehead Data: %d\n", EHead->Link, EHead->Data);
insertAtEnd(EHead, 10);
printf("EHead link: %p Ehead Data: %d\n", EHead->Link, EHead->Data);
return 0;
} //close main