title: Weird string result when creating a basic cipher in c++
body: <p>I'm creating a simple cipher and i got stuck on a weird problem with which i believe is with my IF's.</p>
  <pre><code>    char name[25];
      char cipher[25];
      gets(name);
  
      int i;
      for( i = 0; i &lt;= 25; i++ )
       {
           cipher[i] = name[i];
           if( name[i] = 'g' ) {
              cipher[i] = 'a';
           };
           cout &lt;&lt; cipher[i];
       };
  </code></pre>
  <p><code>cipher[i] = name[i];</code> is there to copy one array to another, so then only one array gets changed. It works. And rest of the program, in my understanding, works like this: if there is a letter <code>g</code> in <code>name[0]</code>, make it a letter <code>a</code> in <code>cipher[0]</code> and if there isn't, just skip, repeat 25 times. But the results are so random to me i don't understand what's going on at all...</p>
  <p><img src="https://i.stack.imgur.com/sOtPn.png" alt="img" /></p>