-1
我有一個我的鏈接列表顯示功能的問題。該功能如下。問題與顯示功能
我只是在switch語句之一中調用函數。但沒有任何顯示。請幫我弄清楚我錯在哪裏。
代碼:
void display()
{
data *cur_point;
cur_point = head;
if(cur_point = NULL)
{
printf("The list is empty");
}
else
{
while(cur_point != NULL)
{
printf("Name : %s \n Contact Number : %d \n",cur_point->name,cur_point->telno);
cur_point = cur_point -> nextp;
}
}
}
請編譯你的程序時使用最大編譯器警告並查看編譯器警告並嘗試修復它們,它們可以幫助你找出像這樣的錯誤 –