title: Making an array using pointers in c
body: <p>I'm new to using c and I'm trying to make a program that makes an array using pointers, </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
    int *i;
    scanf("%d",i);i++;
    while(1){
      scanf("%d",i);
      if(*i==*(i-1)){
       break;}
      printf("%d\n",*i);
      i++;
    }
   return 0;
  }
  </code></pre>
  
  <p>I Keep getting this error </p>
  
  <blockquote>
    <p>Command failed: ./a.out
    Segmentation fault</p>
  </blockquote>