C pointer notation compared to array notation: When passing to function

后端 未结 6 890
野的像风
野的像风 2020-12-01 18:52

My question is base on the following code:

int myfunct(int ary[], int arysize)   
int myfunct2(int *ary, int arysize)

 int main(void){
   int numary[10];
         


        
6条回答
  •  孤城傲影
    2020-12-01 19:09

    Those declarations are absolutely identical. To quote the standard:

    A declaration of a parameter as "array of type" shall be adjusted to "qualified pointer to type"

    C99 standard section 6.7.5.3 paragraph 7

提交回复
热议问题