#include <stdio.h>
#include <stdlib.h>
typedef struct node{
char data;
struct node *next;
}node;
node *CreatList();
void Print(node *head);
//node *p, *q;//*head;
//int n = 0;
void main()
{
node *head;
head = *CreatList();
Print(head);
}
node *CreatList()
{
node *head;
node *p;
int i;
head = (node *)malloc(sizeof(node));
p = head;
for (i = 1; i < 26; i++)
{
p->data = 'a'+ i - 1;
p->next = (node *)malloc(sizeof(node));
p = p->next;
}
p->data = i + 'a' - 1;
p->next = NULL;
return head;
}
void Print(node *head)
{
node *p;
p = head;
while(p)
{
printf("%c",p->data);
p = p->next;
}
}
提示
:error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'struct node' (or there is no acceptable conversion)
请教一下这个怎么改啊!谢谢