title: Strange output when trying to display an array of characters C++
body: <h1>Context</h1>
  <p>I'm trying to create a Rotor struct that holds arrays of characters in a specific sequence.</p>
  <h1>Code</h1>
  <p>Rotor</p>
  <pre><code>struct Rotor
  {
  public:
      char assignedRotor[26];
      void setRotor(int rotor) {
          switch(rotor) {
              case(1):
                  assignedRotor = rotor1;
                  break;
              case(2):
                  assignedRotor = rotor2;
                  break;
              case(3):
                  assignedRotor = rotor3;
                  break;
          };
      }
  private:
      char rotor1[26] = {'E', 'K', 'M', 'F', 'L', 'G', 'D', 'Q', 'V', 'Z', 'N', 'T', 'O', 'W', 'Y', 'H', 'X', 'U', 'S', 'P', 'A', 'I', 'B', 'R', 'C', 'J'};
      char rotor2[26] = {'A', 'J', 'D', 'K', 'S', 'I', 'R', 'U', 'X', 'B', 'L', 'H', 'W', 'T', 'M', 'C', 'Q', 'G', 'Z', 'N', 'P', 'Y', 'F', 'V', 'O', 'E'};
      char rotor3[26] = {'B', 'D', 'F', 'H', 'J', 'L', 'C', 'P', 'R', 'T', 'X', 'V', 'Z', 'N', 'Y', 'E', 'I', 'W', 'G', 'A', 'K', 'M', 'U', 'S', 'Q', 'O'};
  };
  </code></pre>
  <p>Displaying rotor</p>
  <pre><code>int main() {
      Rotor rotor;
      for(int i; i &lt; 26; i++) cout &lt;&lt; enig.rotor2.assignedRotor[i]
      return 0;
  }
  </code></pre>
  <h1>Output</h1>
  <p><a href="https://i.stack.imgur.com/Ar18P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ar18P.png" alt="Output" /></a></p>
  <p>Is my &quot;initialization&quot; or &quot;displaying&quot; incorrect? Or is it both?</p>