user45134: void alarm() {
  char keypressed4;
  char keypressed5;
  char keypressed6;
  char keypressed7;
  char disarmcode1[5];
  Serial.println("hi2");
  Serial.println(disarmcode1);

The array gets declared here and I print the values in the empty array. In the serial monitor I read this:
hi2
"c

I don't know why or how these values get put into the array. I have code later on that puts values into the array, but from where that point in the code is, no values should be in the array
Also I have an LCD screen hooked up too, and it prints a value of 0 at (2, 0).

user41617: Ad to existing answers, while the default behavior of reading unassigned non-instance and non-static memory (e.g. local array) is undefined, you can use slightly different C++ declaration which is defined as initialized to all zeroes:
char disarmcode1[5] = {};

or in pure C
char disarmcode1[5] = {0};


user359: local arrays are not initialized. Reading uninitialized values is Undefined Behavior.
Practically this means that when read they will interpret the bytes at their memory location as values which can result in anything.

user4143: The values haven't been "put" in the array. The array has been located in memory where those values (left over from some earlier operation, possibly as part of a function's stack frame) happen to be.
The simple fact that you haven't put anything in there means that what was there before hasn't been changed.

45134: <pre><code>void alarm() {
  char keypressed4;
  char keypressed5;
  char keypressed6;
  char keypressed7;
  char disarmcode1[5];
  Serial.println("hi2");
  Serial.println(disarmcode1);
</code></pre>

<p>The array gets declared here and I print the values in the empty array. In the serial monitor I read this:</p>

<pre><code>hi2
"c
</code></pre>

<p>I don't know why or how these values get put into the array. I have code later on that puts values into the array, but from where that point in the code is, no values should be in the array</p>

<p>Also I have an LCD screen hooked up too, and it prints a value of 0 at (2, 0).</p>
 41617: <p>Ad to existing answers, while the default behavior of reading unassigned non-instance and non-static memory (e.g. local array) is <em>undefined</em>, you can use slightly different C++ declaration which is <em>defined</em> as initialized to all zeroes:</p>

<pre><code>char disarmcode1[5] = {};
</code></pre>

<p>or in pure C</p>

<pre><code>char disarmcode1[5] = {0};
</code></pre>
 359: <p>local arrays are not initialized. Reading uninitialized values is Undefined Behavior.</p>

<p>Practically this means that when read they will interpret the bytes at their memory location as values which can result in anything.</p>
 4143: <p>The values haven't been "put" in the array. The array has been located in memory where those values (left over from some earlier operation, possibly as part of a function's <a href="https://stackoverflow.com/questions/10057443/explain-the-concept-of-a-stack-frame-in-a-nutshell">stack frame</a>) happen to be.</p>

<p>The simple fact that you <em>haven't</em> put anything in there means that what was there before hasn't been changed.</p>
