DeepaK K C wrote:
Could anybody tell me how to pass array to a function by value?
Passing an array to a function is actually impossible. Passing by
value is easy enough, since C doesn't support any other form of
parameter passing.
Even /trying/ to pass an array by value smacks of silliness
(investigate const for when you pass the address of an object
that you don't wish the function to modify).
But I'm afraid there /is/ a way to do this damn silly thing.
Wrap the array in a struct, and pass the struct by value.
And don't tell anyone I told you.