malloc问题高手来·~急~~

来源:百度知道 编辑:UC知道 时间:2024/06/07 14:21:23
struct student
{
long num;
float score;
struct student *next;
};
struct student *create(void)还有这个`~
{
struct student *head;
struct studnet *p1,*p2;
n=0;
p1=p2=(struct student *)malloc(LEN);这个什么意思啊?
}

struct student *create(void)
这个函数创建一个结构体,返回结构体的指针。
p1=p2=(struct student *)malloc(LEN);
申请LEN字节的内存,p1和p2指向这段内存首部。malloc()是动态内存申请的函数。