M
meisterbartsch
Hi NG,
I have got a starting pointer of a char series (mxArrayToString(pa)).
I also know the length (number of elements by mxGetNumberOfElements) I
want to read.
How do I get a Cstring from those Informations?
I had the Idea to do the following
char* Ps = new char[NumberOfElements(pa)+1];
for (int i=0;i<mxGetNumberOfElements(pa);++i)
{
Ps=*(mxArrayToString(pa)+i*sizeof(char));
TRACE("%c",*(mxArrayToString(pa)+i*sizeof(char))); //debug
}
but this does not work for me. Afterwards I wanted to get a Cstring
from "Ps"...
Any Ideas how to do it right?
Best regards
Patrick
I have got a starting pointer of a char series (mxArrayToString(pa)).
I also know the length (number of elements by mxGetNumberOfElements) I
want to read.
How do I get a Cstring from those Informations?
I had the Idea to do the following
char* Ps = new char[NumberOfElements(pa)+1];
for (int i=0;i<mxGetNumberOfElements(pa);++i)
{
Ps=*(mxArrayToString(pa)+i*sizeof(char));
TRACE("%c",*(mxArrayToString(pa)+i*sizeof(char))); //debug
}
but this does not work for me. Afterwards I wanted to get a Cstring
from "Ps"...
Any Ideas how to do it right?
Best regards
Patrick