title: Is it possible to use an array name pointer for input in this c code?
body: <p>When learning C I wrote a program in which I used the name of an array as a pointer and used it for input. For easier undrerstanding, here's the code of the program:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int i, n, *arr,*p1,*p2,temp;
  
      printf(&quot;Enter the number of elements: &quot;);
      scanf(&quot;%d&quot;, &amp;n);
  
      arr = calloc(n, sizeof(int));
  
      for(i=0;i&lt;n;i++){
          printf(&quot;Enter the %d. element of the array: &quot;, i+1);
          scanf(&quot;%d&quot;, arr+i);
      }
      printf(&quot;\n\n&quot;);
      printf(&quot;Original array output: \n&quot;);
      for(i=0;i&lt;n;i++){
          printf(&quot;%d &quot;, *(arr+i));
      }
      printf(&quot;\n\n&quot;);
      printf(&quot;Output of the array in reverse: \n&quot;);
      for(i=0;i&lt;n/2;i++){
          p1 = arr+i;
          p2 = arr+(n-1)-i;
          temp = *p1;
          *p1 = *p2;
          *p2 = temp;
      }
      for(i=0;i&lt;n;i++){
          printf(&quot;%d &quot;, *(arr+i));
      }
      free(arr);
  
      return 0;
  }
  </code></pre>
  <p>As you can see in line 15 input the element by using scanf(&quot;%d&quot;, arr+1), and later output it as printf(&quot;%d.&quot;, *(arr+1)). Is there any way to input elements using the same arr+1 pointer in C++? I keep getting a 'no match for operator&gt;&gt;' error.</p>