ssGetDataTypeZero
Get the zero representation of a data type
Syntax
void *ssGetDataTypeZero(SimStruct *S, DTypeId id)
Arguments
-
S
-
SimStruct representing an S-Function block.
-
id
-
ID of a data type.
Returns
A pointer (void *
) to the zero representation of the data type specified byid
, ifid
is valid and the data type's size has been set. Otherwise, returnsNULL
and reports an error.
Description
Use to obtain the zero representation of a data type, which is the value that represents zero for the custom data type.
Note
Because this macro reports any error that occurs, you do not need to usessSetErrorStatus
to report the error.
关于使用自定义数据类型的更多信息in S-functions, seeConfigure Custom Data Types.
Languages
C, C++
Example
The following example gets the zero representation of a custom data type.
const void *myZero = ssGetDataTypeZero(S, id); if(myZero == NULL) return;