# How to make a subarray of array?

**URL:** <https://forum.arduino.cc/t/how-to-make-a-subarray-of-array/849990>\
**Category:** Programming\
**Created:** [April 17, 2021, 5:27pm UTC](https://forum.arduino.cc/t/how-to-make-a-subarray-of-array/849990 "2021-04-17T17:27:34Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![jimLee](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jimlee/32/214865_2.png) [@jimLee](https://forum.arduino.cc/u/jimLee)\
**Post date:** [April 18, 2021, 6:45pm UTC](https://forum.arduino.cc/t/how-to-make-a-subarray-of-array/849990/23 "2021-04-18T18:45:17Z")

</div>

@combie Yeah, but you are missing the bit that the OP originally, before erasing his/her posts, wanted to pass in and **create** a subset of **ANY** type of array. Not just a char array. Making things a bit more.. interesting.

-jim lee

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [April 18, 2021, 9:14pm UTC](https://forum.arduino.cc/t/how-to-make-a-subarray-of-array/849990/24 "2021-04-18T21:14:07Z")

</div>

> [@combie](#):
>
> It’s not a second array, it’s a pointer into the existing array

that does not get rid of the 123, which was the ask... (see my answer #3)

---

<div class="post-metadata">

**Author:** ![gfvalvo](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gfvalvo/32/1013044_2.png) [@gfvalvo](https://forum.arduino.cc/u/gfvalvo)\
**Post date:** [April 19, 2021, 12:55am UTC](https://forum.arduino.cc/t/how-to-make-a-subarray-of-array/849990/25 "2021-04-19T00:55:46Z")

</div>

> [@jimLee](#):
>
> @combie Yeah, but you are missing the bit that the OP originally, before erasing his/her posts, wanted to pass in and **create** a subset of **ANY** type of array. Not just a char array. Making things a bit more.. interesting.
> 
> -jim lee

Unfortunately, the code posted in #11 does not accomplish that goal as it only works for objects that are trivially copyable.

---

<div class="post-metadata">

**Author:** ![jimLee](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jimlee/32/214865_2.png) [@jimLee](https://forum.arduino.cc/u/jimLee)\
**Post date:** [April 19, 2021, 1:35am UTC](https://forum.arduino.cc/t/how-to-make-a-subarray-of-array/849990/26 "2021-04-19T01:35:48Z")

</div>

> [@gfvalvo](#):
>
> Unfortunately, the code posted in #11 does not accomplish that goal as it only works for objects that are trivially copyable.

OH, so what did you come up with?

-jim lee

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 17, 2021, 1:35am UTC](https://forum.arduino.cc/t/how-to-make-a-subarray-of-array/849990/27 "2021-08-17T01:35:50Z")

</div>

Closed on August 17, 2021, 1:35am UTC

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.

[Previous page](https://forum.arduino.cc/t/how-to-make-a-subarray-of-array/849990.md?page=1)
