title: Save string reverse
body: <p>I try to run reverse on string But it does not work for me. </p>
  
  <p>For example i tried:-<br>
  Run to the letter Z in <code>str</code> and store all the letter that comes between the letter <code>Z</code> and <code>A</code> on a new string <code>str1</code>.</p>
  
  <p>My code:</p>
  
  <pre><code>int main()
  {  
      char str[8] = "RREADFZ";
      char str1[8];
      int i,k;
  
      for(i =0; i&lt;8; i++)
      {
           if(str[i] == 'Z')
           {
                   while(str1[k] != 'A')
                   {
                        str1[k] = str[i];
                        i--;
                        k--;
                   } 
           }
      } 
      printf("%s\n",str1);
  }
  </code></pre>