11.txt的内容为: AA BB CC DD EE FF AA BB CC DD EE FF AA BB CC DD EE FF AA BB CC DD EE FF
编译有错误,不知道怎么回事error C2039: 'Tokenize' : is not a member of 'CString' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' fatal error C1903: unable to recover from previous error(s); stopping compilation 执行 cl.exe 时出错.
{
float fp;
int xx; stream = fopen( "fscanf.file", "r" );
if( stream == NULL )
printf( "The file fscanf.out was not opened\n" );
else
{
fscanf( stream, "%x ", xx );
fclose( stream );
}
}
->fscanf( stream, "%x ", &xx );
using namespace std;try
{
CFile file;
file.Open(_T("F:\\11.txt"), CFile::modeRead);
int len = (int)file.GetLength();
char* szBuf = new char[len+1];
memset(szBuf, 0, sizeof(char)*(len+1)); file.Read(szBuf, len);
file.Close(); CString strText(szBuf);
delete szBuf;
LPCTSTR szToken = _T(" ");
int curPos = 0;
CString strToken = _T(""); vector<float> vec;
vec.clear(); while(_T("") != (strToken = strText.Tokenize(szToken, curPos)))
{
float ftmp = (float)_tcstoul(strToken, NULL, 16);
vec.push_back(ftmp);
} CString strMsg(_T(""));
CString strTmp(_T("")); for(vector<float>::const_iterator iter = vec.begin(); iter != vec.end(); iter++)
{
strTmp.Format(_T("%f"), *iter);
strMsg += strTmp + _T("\r\n");
}
AfxMessageBox(strMsg);
}
catch (CFileException* e)
{
e->ReportError();
e->Delete();
}
AA BB CC DD EE FF AA BB CC DD EE FF AA BB CC DD EE FF AA BB CC DD EE FF
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
fatal error C1903: unable to recover from previous error(s); stopping compilation
执行 cl.exe 时出错.