# Returning a static array from a function.

**URL:** <https://forums.unrealengine.com/t/returning-a-static-array-from-a-function/772436>\
**Category:** UDK Programming and UnrealScript\
**Tags:** unreal-engine\
**Created:** [February 16, 2023, 9:09pm UTC](https://forums.unrealengine.com/t/returning-a-static-array-from-a-function/772436 "2023-02-16T21:09:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coldscooter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Coldscooter](https://forums.unrealengine.com/u/Coldscooter)\
**Post date:** [February 16, 2023, 9:09pm UTC](https://forums.unrealengine.com/t/returning-a-static-array-from-a-function/772436/1 "2023-02-16T21:09:24Z")

</div>

Seems like it would be obvious, however this code will not compile:

```auto
function SomeType[2] GetMyStaticArray()
```

Compiler complains that the function is missing a name. What is the correct signature for returning a static array?

---

<div class="post-metadata">

**Author:** ![Nathaniel3W](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nathaniel3W](https://forums.unrealengine.com/u/Nathaniel3W)\
**Post date:** [February 17, 2023, 10:34am UTC](https://forums.unrealengine.com/t/returning-a-static-array-from-a-function/772436/2 "2023-02-17T10:34:41Z")

</div>

If you can’t return a static array, I guess you can’t return a static array. Can you make a struct that contains a static array and return that?

---

<div class="post-metadata">

**Author:** ![Coldscooter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Coldscooter](https://forums.unrealengine.com/u/Coldscooter)\
**Post date:** [February 17, 2023, 9:30pm UTC](https://forums.unrealengine.com/t/returning-a-static-array-from-a-function/772436/3 "2023-02-17T21:30:22Z")

</div>

I imagine you would be able to. I feel like this is more of a compiler oversight. Not a big deal, i was just curious if there was an obvious issue with my example.
