#include
//缺少头文件
//#include
//#include
struct good{int a;char b,c;char d[6];struct*link;};
struct good*f,*g,*head;//缺少定义*tail,*node
void main()
{head=(struct good*)molloc(sizeof(struct good));//malloc
head->link=NULL;
tail=head;
node=(struct good*)molloc(sizeof(struct good));
node->a=10;
node->b=r;//字符单引号
node->c=h;//同上
node->d="china";//字符串不能直接用等于
node->link=NULL;
tail->link=node;
tail=node;
};
还有你的程序写的格式太不够标准了。。楼上的格式你就可以学习~!
#include
#include "malloc.h"
#include "string.h"
struct good
{
int a;
char b,c;
char d[6];
struct good *link;
};
struct good*f,*g,*head;
void main()
{
struct good *tail = NULL;
struct good *node = NULL;
head=(struct good*)malloc(sizeof(struct good));
head->link=NULL;
tail=head;
node=(struct good*)malloc(sizeof(struct good));
node->a=10;
node->b='r';
node->c='h';
strcpy(node->d, "china");
node->link=NULL;
tail->link=node;
tail=node;
};
缺少必要的头文件,指针类型错误。
菜鸟?