user47060: I have int arr[50][2]; and I need to send it through Serial. But I don't know how to do it. is it possible?

user37622: In the comment you write that the receiving end is an Arduino too. Then you can send the data in binary form.
To send the array: 
Serial.write((byte*) arr, sizeof(arr));


(byte*) is cast of the memory location of arr to a byte array
sizeof returns the size of the array in bytes

To receive the binary data you must know the size. Here we read 100 16-bit integers:
Serial.readBytes((byte*) arr, 100 * sizeof(short));

Function readBytes is one of the 'timed' functions of Stream. It waits for the next byte (until timeout).
If one Arduino is 8-bit and the second is 32-bit, then use the type short instead of int, because the size of type int is different, but the type short is 16 bit long on all Arduinos.

47060: <p>I have <code>int arr[50][2];</code> and I need to send it through Serial. But I don't know how to do it. is it possible?</p>
 37622: <p>In the comment you write that the receiving end is an Arduino too. Then you can send the data in binary form.</p>

<p>To send the array: </p>

<pre><code>Serial.write((byte*) arr, sizeof(arr));
</code></pre>

<ul>
<li><code>(byte*)</code> is cast of the memory location of arr to a byte array</li>
<li><code>sizeof</code> returns the size of the array in bytes</li>
</ul>

<p>To receive the binary data you must know the size. Here we read 100 16-bit integers:</p>

<pre><code>Serial.readBytes((byte*) arr, 100 * sizeof(short));
</code></pre>

<p>Function <a href="https://www.arduino.cc/reference/en/language/functions/communication/stream/streamreadbytes/" rel="nofollow noreferrer">readBytes</a> is one of the 'timed' functions of Stream. It waits for the next byte (until timeout).</p>

<p>If one Arduino is 8-bit and the second is 32-bit, then use the type <code>short</code> instead of int, because the size of type int is different, but <a href="https://www.arduino.cc/reference/en/language/variables/data-types/short/" rel="nofollow noreferrer">the type short is 16 bit long on all Arduinos</a>.</p>
