cmd.Format(_T("segwin.exe -i %s%s.jpg -t 6 -o segResult\\seg\\%s.jpg 0.9 -r9 setResult\\map\\%s.jpg -q 255"),trainingDir,fileName,fileName,fileName);
system(cmd);
错误显示是无法将CString转为 const char *;请各位大侠帮忙啊
system(cmd);
错误显示是无法将CString转为 const char *;请各位大侠帮忙啊
system(T2A(cmd));
int* buf = NULL;
#ifdef _UNICODE
int len = WideCharToMultiByte(CP_ACP,.., str, -1, buf, 0,...);
buf = new char[len];
memset(buf, 0, len);
WideCharToMultiByte(CP_ACP, ..., str, -1, buf, len, ...);
#else
int len = str.GetLength() + 1;
buf = new char[len];
memset(buf, 0, len);
sprintf(buf, "%s", str);
#endif
...
...
delete[] buf;
buf = NULL;