尝试在C中传递数组时出现冲突类型

use*_*116 0 c arrays

我试着用C写一个程序:

这是一段代码:

#include <stdio.h>
int i, left, right, largest = 0, n = 9;
int a[] = {23, 12, 22, 1, 4, 5, 16, 8, 9, 10};
int main()
{
 sort(a);
 //code to print sorted numbers here
 return 0;

}

void sort(int a[])
{
 buildheap(a);
 for(i = n; i < 0; i--)
 {
  exchange(i, 0);
  n = n - 1;
  maxheap(a, 0);
 }
}
Run Code Online (Sandbox Code Playgroud)

它显示如下警告:

heapsort.c:16: warning: conflicting types for âsortâ
Run Code Online (Sandbox Code Playgroud)

这是因为我不包括在内conio.h吗?

当我试图包含conio.h时,gcc编译器抛出错误,找不到conio.h.

有关上述警告及其与conio.h的相关性/不相关性的任何链接或解释都将有所帮助

更新

对不起缺少这里的基础知识.

非常感谢.我的程序运行正常

hmj*_*mjd 8

这是因为在sort()使用之前没有声明.如果函数在使用之前未声明(或定义),则会生成带有签名的隐式声明(编译器应发出隐式声明警告)int sort().添加声明或将定义移到之前main().

可能同样的问题buildheap(),exchange()并且maxheap():我不认识这些功能.