+ 3
Does this program passes array to function by value or by reference?
https://code.sololearn.com/c9nwte925Nt7/?ref=app if it's by reference how to pass it by value and vice-versa
6 Respostas
+ 3
Check out this article. I've never done it in C, but have done it many times in VBA
https://beginnersbook.com/2014/01/c-passing-array-to-function-example/
+ 3
you don't have to put extra effort to pass array as reference....it's by default passed as reference even if you follow pattern of passing as value
+ 3
Thanks Ketan Lalcheta.
Duncan i guess i can use your idea.
i need to complete my assignment :P
+ 1
one cannot pass array by value..it's always pass by reference
+ 1
Ketan Lalcheta
i have an assignment where i'm supposed to pass array by value. So what do i do?
+ 1
it's passed as reference only...that is the reason you are getting updated values in main function after function call as well... one can not pass array as pass by value for array