当我尝试在 Visual Studio 中编译代码时,每个 for 循环都会出现 C2065 错误,如下所示:
int i;
for (i = 0; i < PQntuples(res); ++i)
{
printf(STATISTICS_TABLE_LINE, PQgetvalue(res,i,0), PQgetvalue(res,i,1),
PQgetvalue(res,i,2), PQgetvalue(res,i,3), PQgetvalue(res,i,4));
}
错误说:
error C2065: 'i': undeclared identifier
如您所见,我声明了标识符i
,但我仍然收到此错误。有谁知道为什么?