# Multi Dimensional Arrays

**URL:** <https://forum.codewithmosh.com/t/multi-dimensional-arrays/17600>\
**Category:** C++\
**Created:** [January 11, 2023, 6:04am UTC](https://forum.codewithmosh.com/t/multi-dimensional-arrays/17600 "2023-01-11T06:04:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![swinston07](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@swinston07](https://forum.codewithmosh.com/u/swinston07)\
**Post date:** [January 11, 2023, 6:04am UTC](https://forum.codewithmosh.com/t/multi-dimensional-arrays/17600/1 "2023-01-11T06:04:11Z")

</div>

So Im trying to create a multidimensional array that outputs the values of lanes and times as shown in my code. When I run the compiler the console outputs the values correctly. However, the compiler also out puts 3 extra 0s at the end. I have no idea where they are coming from. Any suggestions? i’ll include the screen w/ just the code, and the screen w/ the output as well.

 ![Screenshot (8)](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/3/34785f81f1b504c0f0ffc8b43db6848d8e9b2a16.png)

---

<div class="post-metadata">

**Author:** ![swinston07](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@swinston07](https://forum.codewithmosh.com/u/swinston07)\
**Post date:** [January 11, 2023, 6:04am UTC](https://forum.codewithmosh.com/t/multi-dimensional-arrays/17600/2 "2023-01-11T06:04:43Z")

</div>

![Screenshot (9)](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/e/e6092fa5b198376a1d586ac6fee8e83d5a42a79c.png)

Here is the Output I am getting

---

<div class="post-metadata">

**Author:** ![thedubsin](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@thedubsin](https://forum.codewithmosh.com/u/thedubsin)\
**Post date:** [January 16, 2023, 12:46pm UTC](https://forum.codewithmosh.com/t/multi-dimensional-arrays/17600/3 "2023-01-16T12:46:09Z")

</div>

your matrix will look like

```auto
1 2 3
22.5 22.1 22.03
0 0 0

```

because you have specified the dimensions as 3x3. change the dimension to 2x3 (i.e. const inst lanes=2).

---

<div class="post-metadata">

**Author:** ![swinston07](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@swinston07](https://forum.codewithmosh.com/u/swinston07)\
**Post date:** [January 17, 2023, 9:32pm UTC](https://forum.codewithmosh.com/t/multi-dimensional-arrays/17600/4 "2023-01-17T21:32:39Z")

</div>

Thank you!  
It worked perfectly
