顺序查找出错,求解
程序代码:
#include<stdio.h> #define MAX 100 typedef int keytype; typedef struct { keytype key; }elemtype; typedef struct { elemtype elem[MAX+1]; int length; }SStable; void create_seq(SStable *list); int seq_search(SStable *list,keytype k); void main() { SStable *list,table; keytype key; int i; list=&table; printf("请输入顺序表的长度:"); scanf("%d",&list->length); create_seq(list); printf("创建顺序表的内容:\n"); for(i=0;i<list->length;i++) printf("list.elem[%d].key=%d\n",i+1,list->elem[i].key); printf("查找关键字:"); scanf("%d",&key); seq_search(list,key); } void creat_seq(SStable *list) { int i; printf("请输入顺序表的内容:\n"); for(i=0;i<list->length;i++) { printf("list.elem[%d].key=",i+1); scanf("%d",&list->elem[i].key); } } int seq_search(SStable *list,keytype k) { int i=0,flag=0; while(i<list->length) { if(list->elem[i].key==k) { printf("查找成功.\n"); flag=1; printf("list.elem[%d].key=%d\n",i+1,k); } i++; } if(flag==0) printf("没有找到数据%d! \n",k); return(flag); }shunxuchazhao.obj : error LNK2001: unresolved external symbol _create_seq
Debug/shunxuchazhao.exe : fatal error LNK1120: 1 unresolved externals