External Interfaces/API Reference |
C Syntax
Arguments
array_ptr
Pointer to a string mxArray
; that is, a pointer to an mxArray
having the mxCHAR_CLASS
class.
Returns
A C-style string. Returns NULL on out of memory.
Description
Call mxArrayToString
to copy the character data of a string mxArray
into a C-style string. The C-style string is always terminated with a NULL
character.
If the string array contains several rows, they are copied, one column at a time, into one long string array. This function is similar to mxGetString
, except that:
mxArrayToString
does not free the dynamic memory that the char
pointer points to. Consequently, you should typically free the string (using mxFree
) immediately after you have finished using it.
Examples
See mexatexit.c
in the mex
subdirectory of the examples
directory.
For additional examples, see mxcreatecharmatrixfromstr.c
and mxislogical.c
in the mx
subdirectory of the examples
directory.
See Also
mxCreateCharArray
, mxCreateCharMatrixFromStrings
, mxCreateString
, mxGetString
mxAddField | mxAssert |