我想让程序读取文本文件并使用该行功能,但我得到一个错误!C++错误来读取字节线
5 IntelliSense: operand types are incompatible ("BYTE" and "char *")
Error 1 error C2446: '==' : no conversion from 'char *' to 'int'
Error 2 error C2040: '==' : 'int' differs in levels of indirection from 'char [260]'
我的代码:
char* ReadINI(char* szSection, char* szKey, const char* szDefaultValue)
{
char* szResult = new char[255];
memset(szResult, 0x00, 255);
GetPrivateProfileString(szSection, szKey, szDefaultValue, szResult, 255, ".\\Config.ini");
return szResult;
}
int main (Classdata* Cdata)
{
BYTE ByteID = Cdata->ByteType;
static char ReadByte[MAX_PATH];
sprintf(ReadByte, "%s", ReadINI("CONFIG", "Key", "0"));
if (ByteID == ReadByte)
{
printf("Byte Value: %p", ReadByte);
}
}
'使用函数行',您的标题是无意义的。 – EJP