哗哗哗723 2022-03-06 13:12 采纳率: 100%
浏览 28
已结题

大一新生,c语言结构体指针

创建链表时为什么结构体指针分配内存后无法访问内部的变量了呢?
typedef struct student {
char FirstName[100];
char LastName[100];
char SSN[15];
int courseat;
course cou[10];
student* next;

}student,*student;

struct student* creatlinklist() {
student* head = new student[];
head.next = NULL;
}

img

  • 写回答

3条回答 默认 最新

  • CSDN专家-link 2022-03-06 13:27
    关注

    head是指针,应该写成:head->next = NULL;

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 3月16日
  • 已采纳回答 3月8日
  • 创建了问题 3月6日