我建立了一个链表,Node有三个指针,*Head,*Tail,*Now,节点的数据类型为一个类
class Employee
{
public:
int Number;
char Name[10];
char Sex[4];
int Birth[2];
char Caption[15];
char Degree[15];
int Salary;
BOOL Marriage;
Employee();
void SetData(Employee &);
};
当我将Now指向当前操作的对象Temp时(Now=Temp;)(Temp是动态分配的空间Temp=new Employee)报错.
而且,一段很正常的代码也会出错:
Employee * Data;
Data=new Employee;
说error C2501: 'Data' : missing storage-class or type specifiers
有那位大虾知道,请指点一下,小弟感激不尽。
class Employee
{
public:
int Number;
char Name[10];
char Sex[4];
int Birth[2];
char Caption[15];
char Degree[15];
int Salary;
BOOL Marriage;
Employee();
void SetData(Employee &);
};
当我将Now指向当前操作的对象Temp时(Now=Temp;)(Temp是动态分配的空间Temp=new Employee)报错.
而且,一段很正常的代码也会出错:
Employee * Data;
Data=new Employee;
说error C2501: 'Data' : missing storage-class or type specifiers
有那位大虾知道,请指点一下,小弟感激不尽。
解决方案 »
- VC中如何在对话框中使用自定义的菜单
- 关于单文档多视图的问题
- TreeCtrl 加减号的问题
- 今天遇到个比较奇怪的问题...10038错误
- char [] 付值问题,简单问题
- 求教VSS客户端连接服务端的问题。
- 路过的帮忙看看,多进程间如何激发时间!COM组件!两个EXE!
- BHO中DISPID_BEFORENAVIGATE2事件的参数问题
- 请问VC++软件工程师:熟悉(不敢说精通)VC编程,比如在网络通讯,底层驱动或者图形学能够拿多少工资?请前辈真诚对待!
- 请注意,送分了~!~
- 如何用ADO访问数据库,我怎么总是更新失败,代码在内容中
- 请问如何通过程序得知mediaplayer 的版本号,谢谢!
可能是这样的情况:你的类构造函数没有定义。
这样,在new新建一类对象时发现构造函数没有定义(实现),于是给出
—thiscall的编译时调用错误,和一个unresolved externals LINK错误。 是不是这样的错?
'identifier' : missing storage-class or type specifiersThe identifier was declared without specifying its type. The most typical cause of this error is a typographical error. Recheck the identifier to ensure it is spelled correctly and that the alphabetic case is correct.
This error may occur when a type specifier is omitted in the declaration of an identifier. In the following example, assume the header file for the class CUndeclared has been omitted:
class CMyClass {
private:
CUndeclared m_myClass; // Error: Class unknown
} ;