title: Want to store "char values" in array (in C language)
body: <p>I want to store "char data type values" in an array, but it doesn't work.</p>
  
  <p>First, I tried using "gets"
  but it gave me a run time error.
  Code was like this</p>
  
  <pre><code>   int tmp = 0;
  
  
     char arr[100] = { 0, };
     while (arr[tmp]!=NULL)
     {
        gets(arr[tmp]);
        tmp++;
     }
     for (int rtmp = 0; rtmp &lt; a; rtmp++)
      printf("%s ", arr[rtmp]);
     return 0;
  </code></pre>
  
  <p>In a second way, I was using "scanf", but I couldn't store "char data type(it should be more than one character like string)", but only one character was available.(I tried %s, but it doesn't work)
  Plus, it doesn't print the last value of array.</p>
  
  <pre><code>int a = 0;
  scanf("%d", &amp;a); //determine how much I input values
  
  int tmp = 0;
  char arr[100] ={ 0 , };
  for(tmp=0;tmp&lt;a;tmp++)
  {
      scanf("%c ",arr[tmp]);
      fflush(stdin);
  }
  for (int rtmp = 0; rtmp &lt; a; rtmp++)
      printf("%c ", arr[rtmp]);
  return 0;
  </code></pre>
  
  <p>The most "identical" for me is
  without notifying "a" values("a" means how much values I input)
  and storing "char values" in array..</p>
  
  <p>How can I solve this problem? 
  Thanks in advance! Your help is always appreciated :)</p>