|
楼主 |
发表于 2008-2-29 00:55:51
|
显示全部楼层
<DIV class=quote><B>以下是引用<I>imkyo</I>在2008-2-28 12:53:56的发言:</B>
有什么问题,有问题是因为你的取值格式有问题.
一知名手机设计公司是这样写的
else
{
cc.Replace("NAN","-1");
strcpy(buf_Power,cc);
sscanf(buf_Power,"%lf,%lf,%lf,%lf,%lf,%s ,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
&(pPowerData->dbAvgBurstPwCurr),
&(pPowerData->dbPeakBurstPwCurr),
&(pPowerData->nPowerControlLevel),
&(pPowerData->dbTimingAdvError),
&(pPowerData->dbBurstOutofTol),
&(pPowerData->chBurstMatching),
&(pPowerData->dbPhErrPeakCurrent),
&(pPowerData->dbPhErrPeakAverage),
&(pPowerData->dbPhErrPeakMaxMin),
&(pPowerData->dbPhErrRMSCurrent),
&(pPowerData->dbPhErrRMSAverage),
&(pPowerData->dbPhErrRMSMaxMin),
&(pPowerData->dbFreqErrCurrent),
&(pPowerData->dbFreqErrAverage),
&(pPowerData->dbFreqErrMaxMin),
&(pPowerData->dbAvgBurstPwAvg));
}
如果只做获取那个MATC,很简单,strtok(cc,","),及strtok(NULL,",")就可以取到了.</DIV>
试过你的格式但还是抓不到MATC和之后的数据...
请指教问题在哪?
sscanf抓字符串好象不要地址符号&的,但你发的这个里面抓字符串有地址,有点不明白,请指教谢谢! |
|