+ 1
In c why we don't have to return an array
If we have some values in an array inside main() function and we pass it to other function and change all that values how come we see the changed value in our main function :/ i know the answer but just want to know your views about it.
2 odpowiedzi
+ 13
C is all about memory pointers
and arrays are treated as such
when you pass an array to a function you are actually passing its starting address
so the same way that passing a variable by pointer to another function and modifiyng it inside that function will be reflected in the function that passed the pointer
you are simply passing by address rather than value
+ 1
WOOH