I am a beginning programmer and know little about C. One thing I know but have not had explained to me is why functions can't return arrays. This is easily circumvented (Return a 2d array from a function) by use of pointers or by wrapping the array in a struct
, but my question is "Why?".
Why can't functions return arrays?
I am aware that there are easy workarounds, but the question has been bugging me ever since I discovered it. Is this a flaw in C's internal design, or was this put there on purpose? Is there a particular reason that this limitation exists?