title: why is my string ( char array ) is not printing?
body: <p>I try to execute a simple program in c++ and I am not able to get that result what should I do now I tried this code with different versions on gcc compiler in different platform.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string.h&gt;
   using namespace std;
  
   int main()
  {
      int i,m,j;
     char a[10],b[10],temp;
      cout &lt;&lt; " give the string " &lt;&lt; endl;
      cin &gt;&gt; a;
      cout &lt;&lt; a;
      m=strlen(a);
      j=0;
     for(i=m;i&gt;0;i--){
      b[j]=a[i];
      cout &lt;&lt; " inloop "&lt;&lt;b;
       j++;
   }
  cout &lt;&lt; b &lt;&lt; endl;
  return 0;
  </code></pre>
  
  <p>}</p>