C++ Pointer and Memory Allocation
<p>I am teaching myself C++.  It is my first programming language and I am struggling with the wording associated with the memory allocation of pointers.</p>

<p>Consider this statement:</p>

<pre><code>int *p;
int x;
p = &amp;x;
*p = 8;

          Value
&amp;p        1400
p         1800
*p        8
x         8
</code></pre>

<p>&amp;p is the memory address of p.</p>

<p>p is the memory address pointed to by the pointer p.</p>

<p>*p is the value of the memory address pointed to by the pointer p.</p>

<p>I understand this. However the book states:</p>

<p>p = &amp;x stores the address of x in p. However, no new memory is allocated.</p>

<p>This is confusing.  Memory has been allocated, else p would be undefined.</p>

<p>Now consider this statement:</p>

<pre><code>int *p;
p = new int;
*p = 28;
</code></pre>

<p>Here, you dont need an additional variable to make *p valid and meaningful, because memory has been allocated.</p>

<p>So, I guess my question is:</p>

<p>What is the author's meaning of his statement, "Memory is not allocated.", when considering the code block?</p>