title: How to input a character in character array using loop in C?
body: <p>what I want to do is input characters in character array in loop .I am new to c programming and don't know uses of pointers very well.my input is something like this :<br></p>
  
  <pre><code>INPUT:
  a b
  c d
  e f upto n times
  </code></pre>
  
  <p>I have declared two arrays <code>char a[n],b[n];</code> and I want to input a in <code>a[0]</code>, b in <code>b[1]</code>, c in <code>a[2]</code>...</p>
  
  <p>Here is my attempt</p>
  
  <pre><code>char a[n],b[n];
  for(i=0;i&lt;n;i++)
  {
    scanf("%c %c",&amp;a[i],&amp;b[i]);
    printf("%c %c",*(a+i),*(b+i));
  }
  </code></pre>
  
  <p>but this doesn't work!!if I input:  a b  the output is a a 
   `</p>