passing argument makes pointer from integer

后端 未结 4 1377
猫巷女王i
猫巷女王i 2020-12-19 06:34

I can\'t find my problem. keeps giving me these errors:

\"c:2:5: note: expected \'int *\' but argument is of type \'int\'\"
\"c:28:1: warning: passing argume         


        
4条回答
  •  甜味超标
    2020-12-19 07:33

    Try this.

    #include 
    #include 
    
    int CountEvenNumbers(int numbers[], int length);
    int main(void)
    {
        int length;
        int X;int Z; int Y; int W;
        X=0;Y=0;Z=0;W=0;
        printf("Enter list length\n");
        scanf("%d",&length);
    
        int *numbers = (int*) calloc(length, sizeof(int)); //***************
    
    
        if (length<=0)
        {printf("sorry too low of a value\n");
        return 0;}
        else
        {
            printf("Now, enter %d integers\n",length);
            for (X=0;X

提交回复
热议问题