# Can you make 2D arrays in C++? If so, how?

**URL:** <https://forums.unrealengine.com/t/can-you-make-2d-arrays-in-c-if-so-how/466261>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 4, 2020, 10:48pm UTC](https://forums.unrealengine.com/t/can-you-make-2d-arrays-in-c-if-so-how/466261 "2020-06-04T22:48:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/samathan/32/1058905_2.png) [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Post date:** [June 4, 2020, 10:48pm UTC](https://forums.unrealengine.com/t/can-you-make-2d-arrays-in-c-if-so-how/466261/1 "2020-06-04T22:48:20Z")

</div>

I’m surprised that I couldn’t find a single video, post, or other form of information on how to create Unreal Engine 2D arrays in C++. I couldn’t even find anything saying definitely whether or not it’s possible. Can someone help me out?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Ardomation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ardomation](https://forums.unrealengine.com/u/Ardomation)\
**Post date:** [June 4, 2020, 11:44pm UTC](https://forums.unrealengine.com/t/can-you-make-2d-arrays-in-c-if-so-how/466261/2 "2020-06-04T23:44:59Z")

</div>

If you mean a multidimensional array, I believe you can if you don’t plan on exposing them in the editor using `UPROPERTY()`. Otherwise if you are using it purely in C++ I think you can do something like `TArray<TArray<int>> foo;`

Otherwise if you need to expose them to the editor, the closest thing I could find was using a struct.

---

<div class="post-metadata">

**Author:** ![Ceteri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ceteri](https://forums.unrealengine.com/u/Ceteri)\
**Post date:** [February 9, 2021, 11:19pm UTC](https://forums.unrealengine.com/t/can-you-make-2d-arrays-in-c-if-so-how/466261/3 "2021-02-09T23:19:51Z")

</div>

Thanks for this, i have read so many posts saying it can’t be done in C++ and to use structs. I just tried this with a 3D array and it appears to work fine, i guess i’ll run into problems when i find out further down the line i need to expose it to blueprint!

---

<div class="post-metadata">

**Author:** ![Ardomation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ardomation](https://forums.unrealengine.com/u/Ardomation)\
**Post date:** [February 19, 2021, 12:34am UTC](https://forums.unrealengine.com/t/can-you-make-2d-arrays-in-c-if-so-how/466261/4 "2021-02-19T00:34:55Z")

</div>

No problem! Glad it helped out.
