0

Is it right to say that....since arrays are passed by address automatically...so there's no need and reason to return arrays from functions(Is that the reason why it is not allowed in c/c++)

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by Stoned_coder
0

there is a need and a reason to return arrays and it can be done, you just return a pointer to its first address. If what you meant was an array return by value, i.e. a copy of the array then yes this never happens in c++. arrays are always treated as reference types.They are not copied into funcs or out of them.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.