How can I use arithmetic operations (for C pointers) using coder.opaque types?
Afficher commentaires plus anciens
Hello everyone,
I am into a project that uses coder.opaque to create char*, and I need memcpy to another another variable coder.opaque type, applying arithmetic operations to that "pointers".
Following I show you an example to explain what I am saying better:
first = coder.opaque('char*');
last = coder.opaque('char*');
def = coder.opaque('char*');
def = coder.ceval('(char*) malloc', 100);
% some operations %
memcpy(def, first+1, last-first); % Error. Expected either a <basic types>. Found a coder.opaque
How can I apply, or do the same, '+'/'-' operators to coder.opaque variables pointers, for move into the memory?
Regards,
Marcel
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur External Code Integration dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!