马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大哥,我在使用UF_UI_select_feature函数时总用问题,我不知道什么原因。代码附下,在注释里有问题说明,望指点。
void select_multi_feature(void)
{
int count=0,response;
tag_t **feature_tag=malloc(100*sizeof(tag_t));
char message[200]={""};
int i=0;
char feature_str[20];
tag_t tag_h=NULL_TAG;
UF_UI_select_feature(
"选择特征" ,/* <I>
Cue line message to display.
*/
NULL ,/* <I>
Must be NULL or castable to UF_UI_feat_sel_type_t*.
*/
&count ,/* <O>
Count features selected
*/
feature_tag ,/* <OF,len:count>
Allocated array of selected feature tags. After use
must be freed with UF_free
*/
&response /* <O>
response:
UF_UI_BACK
UF_UI_CANCEL
UF_UI_OK
*/
);
if (response==UF_UI_OK)
{
//*
// 执行循环的时候总是内部报错***************
sprintf(message,"选择特征的数量=%d\n",count);
for(i=0;i<count;i++)
{
tag_h=*(*feature_tag+i);
sprintf(feature_str,"第%d特征tag=%d \n",i+1,tag_h);
strcat(message,feature_str);
}
//*/
//但用这个sprintf就没问题*******************
//sprintf(message,"count=%d,%d,%d",count,*(*feature_tag),*(*feature_tag+1));
uc1601(message,1);
}
free(feature_tag);
}
|