I am writing a C-DLL to be called from MATLAB.
Is it possible to call a function with const char ** parameter? e.g.
void myGetVersion( const ch
I could not get @Amro's solution to work (old version of MATLAB?). So, I had to do something a little more creative:
pstr = libpointer('voidPtr');
ret = calllib('libversion', 'myGetVersion', pstr);
% establish the length
n = 0;
while n==0 || pstr.Value(n) ~= 0
n=n+1;
pstr.setdatatype('uint8Ptr', 1, n);
end
% truncate to exclude the NULL character
pstr.setdatatype('uint8Ptr', 1, n-1);
% convert to string
display(char(pstr.Value))