# Return int array from module

**URL:** <https://forum.arduino.cc/t/return-int-array-from-module/1081196>\
**Category:** Programming\
**Created:** [January 23, 2023, 9:55am UTC](https://forum.arduino.cc/t/return-int-array-from-module/1081196 "2023-01-23T09:55:56Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [January 23, 2023, 10:18pm UTC](https://forum.arduino.cc/t/return-int-array-from-module/1081196/13 "2023-01-23T22:18:04Z")

</div>

There was just a long discussion about this:

> [@Curious about the best way of returning arrays from a function \[solved\]](https://forum.arduino.cc/t/curious-about-the-best-way-of-returning-arrays-from-a-function-solved/1076922):
>
> Hi, I read somewhere that some standard C functions do not work as well in the Arduino interface so I decided to see if it was still possible to return an array from a function. From C language, I know that it is possible to return an array by declaring a variable as static or using malloc. The code that I wrote is shown below: #define SIZE 10 void setup() { Serial.begin(9600); } // Returning a reversed array with malloc int \*func1(int \*x) { int \*p = malloc(sizeof(int)\*SIZE); for (int…

---

_[View the full topic](https://forum.arduino.cc/t/return-int-array-from-module/1081196)._
