title: Use getchar with pointer like char array
body: <pre><code>#include&lt;stdio.h&gt;
  
  int main(){
    char *q;
    int i=0;
    do{
      *(q+i)=getchar();
      i++;
    }while(*(q+i)!=48);
  
    int j=0;
  
    for(;j&lt;i;j++)
      printf("%c",*(q+j));
  }
  </code></pre>
  
  <p>I try to use in this way. I could compile. However ıt does not work .
  My aim is that I wanna acquire char array (unlimited or limit will be defined by the user)
  What should I do?</p>