我在双向链表上编写程序,但我不断收到以下错误:
expected constructor, destructor, or type conversion before = token
expected , or ; before = token
expected constructor, destructor, or type conversion before -> token
expected , or ; before -> token
以下是显示错误的部分:
#include<stdio.h>
#include<malloc.h>
typedef struct node{
int data;
struct node *next,*prev;
}n;
n *head,*a;
head=(n *)malloc(sizeof(n));
head->next=head->prev=NULL;
在来这里之前我尝试了很多东西。一点帮助将不胜感激。