title: Changing The Value Stored In A Particular Address in C++
body: <p>I have recently started object-oriented software development in C++ and I am having a few issues trying to understand pointers. I am using Qt Creator 3.3.0.</p>
  
  <p><strong>1. Using (*type) To Store A New Address In The Variable</strong></p>
  
  <p>why I am always required to do:</p>
  
  <pre><code> int* y = ( int*) 0x61fe9c;
  </code></pre>
  
  <p>To store and address rather than:</p>
  
  <pre><code> int* y = 0x61fe9c;
  </code></pre>
  
  <p>Shouldn't the pointer understand that I am storing a hexadecimal address of a memory location ? </p>
  
  <p><strong>2. Storing A New Particular Address In A Pointer</strong></p>
  
  <p>I am trying to understand why once you store a particular address in a pointer you have to do it in a different way to store a new address:</p>
  
  <pre><code>int* y = ( int*) 0x61fe9c;
  *y = 0x61fe9d;
  </code></pre>
  
  <p>If I do this the the address is stored without any problems but if I want to store it in this other way:</p>
  
  <pre><code>*y = (int*) 0x61fe9d;
  </code></pre>
  
  <p>The compiler gives me the error of <code>invalid conversion from 'int*' to 'int'</code>.</p>
  
  <p>Why can I not change the value of the address stored as shown above ?</p>
  
  <p>Thank you in advance. </p>