title: Explicitly setting the value of a pointer
body: <p>I am writing a mex-file (using C++) that will accept a memory address as an input, and operate on data at that memory address. Because I am forced to use MATLAB as my environment, my program can only accept MATLAB data types as inputs (char, bool, float, double, and int). How can I go about assigning my input value to a pointer?</p>
  
  <p>Pseudocode:</p>
  
  <pre><code>// Outside of program
  // double input_arg = hex2dec('00C2E4E8')
  
  double *pointer;
  pointer = (double *)input_arg;
  // pointer == hex2dec('00C2E4E8')
  </code></pre>
  
  <p>Basically, this can be seen as me hardcoding the value of a pointer similar to: </p>
  
  <pre><code>double *pointer = (double *)hex2dec('00C2E4E8');
  </code></pre>
  
  <p>I am receiving the error: </p>
  
  <blockquote>
    <p>error C2440: '=' : cannot convert from 'double' to 'double *'</p>
  </blockquote>
  
  <p>I have also tried using static/const/reinterpret/dynamic_cast, but I don't really understand how they work (and I couldn't get them to work). Is it possible at all to manually assign memory address values to pointers? </p>