Passing an array as an argument to a function in C

后端 未结 10 1243
太阳男子
太阳男子 2020-11-22 06:03

I wrote a function containing array as argument, and call it by passing value of array as follows.

void arraytest(int a[])
{
    // changed the array a
    a         


        
10条回答
  •  死守一世寂寞
    2020-11-22 06:40

    You are not passing the array as copy. It is only a pointer pointing to the address where the first element of the array is in memory.

提交回复
热议问题