一个冒泡排序的问题,编译出错,找不出原因,求各位大神指点.
#include<stdio.h>int sort(int *p,int len);
int mian()
{
int a[10]={0};
int i,j;
int len=10;
printf("please input 10 integer numbers:\n");
for(i=0;i<len;i++)
{scanf("%d",&a[i]);}
sort(a,len);
for(i=0;i<len;i++)
{printf("%d",a[i]);}
printf("\n");
return 0;
}
int sort(int *p,int len)
{
int i,j,tmp;
for(i=0;i<len-1;i++)
{
for(j=i+1;j<len;j++)
{
if(*(p+i)<*(p+j))
{
tmp=*(p+j);
*(p+j)=*(p+i);
*(p+i)=tmp;
}
}
}
return *(p+i);
}
编译时错误提示是:Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
这个是什么问题呀,求教?