simulink C++ s-funcion data type 'char' error
Afficher commentaires plus anciens
My Ask is how using 'char' type variable
log:
错误使用 mex
E:\资料\SVN_USER\010-panh07\code\simulink\test.cpp: In function 'void mdlOutputs(SimStruct*, int_T)':
E:\资料\SVN_USER\010-panh07\code\simulink\test.cpp:206:28: error: invalid conversion from 'int8_T* {aka signed char*}' to 'char*' [-fpermissive]
strcpy(y0,"hello world");
^
In file included from D:\MATLAB\R2021a/simulink/include/simstruc_compcond.h:108:0,
from D:\MATLAB\R2021a/simulink/include/simstruc.h:64,
from E:\资料\SVN_USER\010-panh07\code\simulink\test.cpp:92:
D:/mingw64_gcc6.3/x86_64-w64-mingw32/include/string.h:61:18: note: initializing argument 1 of 'char* strcpy(char*, const char*)'
char * __cdecl strcpy(char * __restrict__ _Dest,const char * __restrict__ _Source);
^~~~~~
code:
/* Function: mdlOutputs =======================================================
*
*/
static void mdlOutputs(SimStruct *S, int_T tid)
{
const real_T *u0 = (real_T *) ssGetInputPortRealSignal(S, 0);
int8_T *y0 = (int8_T *) ssGetOutputPortRealSignal(S, 0);
strcpy(y0,"hello world");
test_Outputs_wrapper(u0, y0);
}
Réponses (0)
Catégories
En savoir plus sur Block and Blockset Authoring 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!