无法将“浮动*”转换为“浮动”

Abb*_*ndi 0 c arrays return-type incompatibletypeerror function-declaration

#include<math.h>
#include<stdio.h>
#include<stdlib.h>

float array(float a[],int n);

int main() {
    int k=5;
    float a[k+1];
    array(a[k+1],k);
}

float array(float a[],int n )// n = size of array
{
    printf("enter elements in order of increasing:\n");
    for(int i=0;i<n;i++) {
        printf("array[%d]:",i);
        scanf("%f",&a[i]);  
    }
    return a;
}                                   
Run Code Online (Sandbox Code Playgroud)

我想构建一个程序来使用函数给出一个浮点数递增的数组,但它有一个错误,编译器显示这些错误:

[Error] cannot convert 'float*' to 'float' in return9
[Error] cannot convert 'float' to 'float*' for argument '1' to 'float array(float*, int)'
Run Code Online (Sandbox Code Playgroud)

tad*_*man 5

a是类型float*,返回类型是float。您要么需要返回一个浮点数,要么将返回类型转换为指针。