const EPGState* NewEPGState[] =
{
&bootupState,
&standbyState,
&watchtvState,
&guideState,
&settingsState,
&easState,
&diagnosticsState
};
此代码有什么问题?我在'*'令牌之前得到错误解析错误 您的答案将不胜感激。编译器的版本,您使用的这些'*'令牌之前的解析错误
const EPGState* NewEPGState[] =
{
&bootupState,
&standbyState,
&watchtvState,
&guideState,
&settingsState,
&easState,
&diagnosticsState
};
此代码有什么问题?我在'*'令牌之前得到错误解析错误 您的答案将不胜感激。编译器的版本,您使用的这些'*'令牌之前的解析错误
检查,此代码编译以及对 G ++ 4.1.2版20071124. 但我假设你已经定义的类/结构EPGState正确和所有在用gcc
编译失败下面使用的变量是相同的类型,即EPGState。
class EPGState
{
};
int main()
{
EPGState bootupState,standbyState;
const EPGState* NewEPGState[] =
{
&bootupState,
&standbyState
};
}
您是否获得“解析错误”在编译步骤或在运行时。 这个问题并不清楚。
我写了一些示例代码来测试。
#include<iostream>
int main()
{
int a;
int b;
int *ac[]={&a,&b};
return 0;
}
gcc版本4.1.2 20071124(红帽4.1.2-42)
/tmp/cc6829sJ.o: In function __static_initialization_and_destruction_0(int, int)': test1.cpp:(.text+0x4f): undefined reference to std::ios_base::Init::Init()
您probaly有
struct EPGState
{
...
struct EPGState bootupState =
{
...
地方。
然后是应
const struct EPGState * NewEPGState[] =
{
&bootupState,
...
可能EPGState不是有效的类型? – michaeltang
显示您在代码中使用的EPGState和其他变量的声明。 – const
你可以摆出整个来源? –