Monday, May 24, 2010

In C (not C++), is it possible to implement a function that takes an array and returns one?

and how would you write the prototype? thanks.

In C (not C++), is it possible to implement a function that takes an array and returns one?
It's not possible in standard C to pass an array to a function by value, or to return an array from a function. When an array is used as an argument to a function, it's automatically converted to a pointer to the first element of the array.


No comments:

Post a Comment