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?
Pseudocode:
// Outside of program
// double input_arg = hex2dec('00C2E4E8')
double *pointer;
pointer = (double *)input_arg;
// pointer == hex2dec('00C2E4E8')
Basically, this can be seen as me hardcoding the value of a pointer similar to:
double *pointer = (double *)hex2dec('00C2E4E8');
I am receiving the error:
error C2440: '=' : cannot convert from 'double' to 'double *'
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?