Passing an Array by reference in C

后端 未结 5 476
渐次进展
渐次进展 2020-12-01 09:34

I\'m new to C and I have a doubt.

Since C functions create local copies of it\'s arguments, I\'m wondering why the following code works as expected:



        
5条回答
  •  爱一瞬间的悲伤
    2020-12-01 10:15

    There is a difference between 'pass by reference' and 'pass by value'

    Pass by reference leads to a location in the memory where pass by value passes the value directly, an array variable is always an refference, so it points to a location in the memory. Integers will pass by value by default

提交回复
热议问题