请教关于c++里的结构体
我觉得C++里面用结构体好像有些问题,下面的程序:
#include <iostream>
using namespace std;
typedef int ElemType;
class xianxingb
{
public
xianxingb ();
struct sNode
{
ElemType data;
struct sNode* next;
};
struct sNode* HL;
};
xianxingb::xianxingb ()
{
HL = NULL;
}
int main()
{
printf("start\n");
xianxingb S();
cout << "end";
return 0;
}
编译时错误提示:
xianxingb.cpp:8: parse error before `(' token
xianxingb.cpp:18: definition of implicitly-declared `xianxingb::xianxingb()'
xianxingb.cpp:18: declaration of `xianxingb::xianxingb()' throws different
exceptions
xianxingb.cpp:6: than previous declaration `xianxingb::xianxingb() throw ()'
请指教这是怎么回事?
[此贴子已经被作者于2005-5-11 22:20:15编辑过]