也不是多長的函式,就是載入INI檔案里的資料,但是到了st_AD_Val.fVal = (float)atof(strtok_r(NULL, ",",&sp1));
這一句就報錯,咋弄?
BOOL LoadConfigData()
{
char *sp=NULL;
char *sp1=NULL;
CString strCP;
char pBuffer[100] = {0};
m_pChannelCalData.RemoveAll();
int nCalPointCount = ::GetPrivateProfileInt("采集卡", "標定點數量", 0, "./配置.ini");
for (int n = 0; n < nCalPointCount; n++)
{
AD_FLOAT st_AD_Val;
strCP.Format("CP%d", n + 1);
::GetPrivateProfileString("采集卡", strCP, "", pBuffer, MAX_PATH, "./配置.ini");
st_AD_Val.uAD = atoi(strtok_r(pBuffer, ",",&sp));
st_AD_Val.fVal = (float)atof(strtok_r(NULL, ",",&sp1));
m_pChannelCalData.Add(st_AD_Val);
}
return 1;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/243045.html
標籤:C語言
上一篇:蘋果iOS APP重簽名工具、Windows一鍵重簽ipa軟體解鎖工具
下一篇:緩沖區溢位和越界訪問有什么聯系嗎
