undefined reference to 'WinMain@16 什么情况?
2.图书资料管理问题设一本书有编号、书名、作者、价格等信息,
如下表
1,"Basic","zhang",15.00
2,"VB","li",20.00
3,"C","wang",18.00
4,"delphi","zhao",23.00
1)设计顺序表并实现以下操作
A、初始化线性表
B、添加表1中的记录
C、删除第三条记录
#include <stdio.h>
#define true 1
#define false 0
#define MAXNUM 10
typedef struct
{
long int num;
char name[50];
char author[20];
float price;
}bookinfo;
typedef struct
{
bookinfo data[MAXNUM];
int length;
}listtype;
void initiatelist(listtype*l);
int delete_b(listtype*l,int i);
int maim()
{
int i;
listtype info;
listtype*l=&info;
initiatelist(l);
bookinfo a[4]={{1,"Basic","zhang",15.00},{2,"VB","li",20.00},{3,"C","wang",18.00},{4,"delphi","zhao",23.00}};
for(i=0;i<4;i++)
{
l->data[i]=a[i];
}
l->length=4;
delete_b(l,3);
return 0;
}
void initiatelist(listtype*l)
{
l->length=0;
}
int delete_b(listtype *a,int i)
{
int j;
if((i<1)||(i>a->length))
{
printf(" i is invalid value !\n");
return(false);
}
for(j=i;j<a->length;j++)
{
a->data[j-1]=a->data[j];
}
a->length--;
return(true);
}
编译链接时出现undefined reference to 'WinMain@16 是什么情况?
[ 本帖最后由 koko_2012 于 2012-3-15 21:38 编辑 ]