Dynamically Allocating Arrays Depending on User Input in C++
<p>im watching this tutorial on youtube <a href="https://www.youtube.com/watch?v=8XAQzcJvOHk" rel="nofollow">https://www.youtube.com/watch?v=8XAQzcJvOHk</a> Dynamically Allocating Arrays Depending on User Input in C++</p>

<p>this is his code</p>

<pre><code>1 int main()
2 {
3   int *pointer = nullptr;
4   
5   cout &lt;&lt; "how many items u are gonna enter" &lt;&lt; endl;
6   int input;
7   cin &gt;&gt; input;
8
9   pointer = new int[input];
10
11  int temp;
12
13  for (int counter = 0; counter &lt; input; counter++) {
14      cout &lt;&lt; "enter the item " &lt;&lt; counter + 1 &lt;&lt; endl;
15      cin &gt;&gt; temp;
16      *(pointer + counter) = temp;
17  }
18
19  cout &lt;&lt; "the items you have entered are" &lt;&lt; endl;
20  for (int counter = 0; counter &lt; input; counter++) {
21      cout &lt;&lt; counter + 1 &lt;&lt; "  item is  " &lt;&lt; *(pointer + counter) &lt;&lt; endl;
22  }
23
24  delete[]pointer;
25
26  return 0;
27}
</code></pre>

<p>im stuck in line 16, i dont understand why is that, inside the (), the pointer variable and counter are added to each other</p>