![]() |
Function that returns a 2d array A function can return a 2d array?Can one some give a explanation of this with example? I tried the following code but does not work... Code: int function (array [] [120]) |
Re: Function that returns a 2d array Is it possible in C++ to have a function that returns a 2-D or indeed an X-D array from a function.Another alternative is to pass in the 2D array as a parameter into the function (by reference) and then filll it and then just leave the function which would maintain the array's content. |
Re: Function that returns a 2d array Return a 2D array from a function in C : Code: #include |
Re: Function that returns a 2d array In your case you pass an array argument (but bad because you did not indicate the type), this table will be modified directly, so it is unnecessary to return. A dynamically allocated 2D array can be returned by cons because it is a pointer to pointer. |
All times are GMT +5.5. The time now is 01:19 PM. |