title: c printing too many chars
body: <p>I'm trying to print out a memory address backwards like in a little endian machine, but for some reason my program is outputting both char arrays in my program.</p>
  
  <pre><code>char address[8];
  char result[16];
  scanf("%s", address);
  int x = 1;
  for(x; x&lt;5; x++)
  {
  int y = 4*x;
  int z = 8 - 2*x;
  result[y-4] = '\\';
  result[y-3] = 'x';
  result[y-2] = address[z];
  result[y-1] = address[z+1];
  }
  printf("%s", result);
  </code></pre>
  
  <p>for example, if I input "12345678" it outputs <code>"\x78\x56\x34\x1212345678"</code>
  I want the <code>"\x78\x56\x34\x12"</code>, but I don't understand why the <code>"12345678"</code> is also printed.</p>