title: Strrev behaving weirdly in C
body: <p>I am new to C programming . I was writing a program to implement big integer addition by representing integers in an array. I put printf everywhere in my main program and figured out that the strrev part is what is causing the problem(i only put the erroneous part here and not the main program obviously. But I cannot figure out what is going wrong.  Can anyone please help me with the same?</p>
  
  <p>Code below-</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  #include&lt;string.h&gt;
  
  struct integer
  {
      char store[200];
      int length;
  };
  void printer2(struct integer x1);
  int main()
  {
  
  struct integer x1;
  x1.store[0]=1;
  x1.store[1]=2;
  x1.store[2]=3;
  x1.store[3]=4;
  x1.store[4]=5;
  x1.length=5; 
  printer2(x1);
  strrev(x1.store);
  printer2(x1);
  return 0; 
  }
  
  void printer2(struct integer a1)
  {
      int j;
      for (j=0;j&lt;a1.length;j++)
      {
          printf("a1 %d is %d\n",j,a1.store[j]);
      }
  };
  </code></pre>