我建立了一个链表,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
有那位大虾知道,请指点一下,小弟感激不尽。

解决方案 »

  1.   


       可能是这样的情况:你的类构造函数没有定义。
       这样,在new新建一类对象时发现构造函数没有定义(实现),于是给出
    —thiscall的编译时调用错误,和一个unresolved externals LINK错误。   是不是这样的错?
      

  2.   

    加入#include "Employee.h"了吗?
      

  3.   

    Compiler Error C2501
    '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
    } ;