调用函数在数组中插入数据

定义函数 int fun(float a[],int x,float e,int n,int t)实现在数组a中第x个元素前插入数据e的功能,(其中n表示数组空间,t表示数组中有效元素个数)。


     /*返回值为1,代表插入成功*/
        int func(float a[], int x, float e, int n, int t)
        {
                int i; 
                float tmp;
                tmp = a[x-1];
                a[x-1] = e;
                if(x - 1< t)
                return func(a, x+1,  tmp, n, t);
                return 1;
        }