c++中关于unexpected 'class' 'Queue'的求救
#include<iostream.h>enumError_code{success,underflow,overflow,fail};structTerm{intdeg...
#include<iostream.h>
enum Error_code {success,underflow,overflow,fail};
struct Term{
int degree;
double coefficient;
Term(int exponent=0,double scalar=0);
};
Term::Term(int exponent,double scalar)
{
degree=exponent;
coefficient=scalar;
}
struct Node{
Term entry;
Node *next;
}
#define Queue_entry Node
class Queue{
public:
// standard Queue methods
Queue();
bool empty() const;
Error_code append(const Queue_entry &item);
Error_code serve();
Error_code retrieve(Queue_entry &item) const;
~Queue();
Queue(const Queue &original);
void operator =(const Queue &original);
bool full() const;
int size() const;
void clear();
Error_code serve_and_retrieve(Queue_entry &item);
protected:struct Node{
Term entry;
Node *next;
};
Node *front, *rear;
};
d:\program files\microsoft visual studio\myprojects\多项式乘除测试\queue_ex.h(30) : error C2236: unexpected 'class' 'Queue' 展开
enum Error_code {success,underflow,overflow,fail};
struct Term{
int degree;
double coefficient;
Term(int exponent=0,double scalar=0);
};
Term::Term(int exponent,double scalar)
{
degree=exponent;
coefficient=scalar;
}
struct Node{
Term entry;
Node *next;
}
#define Queue_entry Node
class Queue{
public:
// standard Queue methods
Queue();
bool empty() const;
Error_code append(const Queue_entry &item);
Error_code serve();
Error_code retrieve(Queue_entry &item) const;
~Queue();
Queue(const Queue &original);
void operator =(const Queue &original);
bool full() const;
int size() const;
void clear();
Error_code serve_and_retrieve(Queue_entry &item);
protected:struct Node{
Term entry;
Node *next;
};
Node *front, *rear;
};
d:\program files\microsoft visual studio\myprojects\多项式乘除测试\queue_ex.h(30) : error C2236: unexpected 'class' 'Queue' 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询