定义一个structstruct _PathNode
{
int g;
int h;
int f;
int x;
int y;
_PathNode * Parent;
_PathNode * NextNode;
_PathNode * Child[8];
}编译时显示
pp.h(9) : error C2236: unexpected 'struct' '_PathNode'
pp.h(9) : error C2143: syntax error : missing ';' before '{'
pp.h(9) : error C2447: missing function header (old-style formal list?)请大虾指点。
{
int g;
int h;
int f;
int x;
int y;
_PathNode * Parent;
_PathNode * NextNode;
_PathNode * Child[8];
}编译时显示
pp.h(9) : error C2236: unexpected 'struct' '_PathNode'
pp.h(9) : error C2143: syntax error : missing ';' before '{'
pp.h(9) : error C2447: missing function header (old-style formal list?)请大虾指点。
{
int g;
int h;
int f;
int x;
int y;
_PathNode * Parent;
_PathNode * NextNode;
_PathNode * Child[8];
}; // 注意这里的分号
:)
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found
struct _PathNode
{
int g;
int h;
int f;
int x;
int y;
struct _PathNode * Parent;
struct _PathNode * NextNode;
struct _PathNode * Child[8];
};
编译有点问题。c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found
{
int g;
int h;
int f;
int x;
int y;
_PathNode * Parent;
_PathNode * NextNode;
_PathNode * Child[8];
};
{
int g;
int h;
int f;
int x;
int y;
_PathNode * Parent;
_PathNode * NextNode;
_PathNode * Child[8];
};
结构体定义结束后要加分号。