[急求助] 实在不知道什么问题了。。。。
实在不知道为什么出现这个错误:error C2143: syntax error : missing ';' before '<', 是stack的语法问题吗?
[code=C/C++][/code]
// linklist.h: interface for the linklist class.
//
//////////////////////////////////////////////////////////////////////
#ifndef _LINKLIST_H_
#define _LINKLIST_H_
#include <stack>
#if _MSC_VER > 1000
#pragma once
#endif
class linklist
{
public:
linklist();
virtual ~linklist();
double time,x,y;
int id;
linklist *prev;
linklist *next;
//
// basic dll operations
/////////////////////////////////////////////////////////
void insertEntry(linklist *&entry, linklist *new_entry);
void showList();
void deleteList(linklist *&entry);
linklist * getentry(linklist *entry, double _time);
linklist * getlast(linklist *);
};
class NODE_entry: public linklist{
public:
double u,v,t;
int id_g;
int get_nodenum(linklist *entry);
};
typedef stack <double> STACK_DOUBLE; //error C2143: syntax error : missing ';' before '<'
class GROUP_entry: public linklist{
public:
STACK_DOUBLE his_x;
STACK_DOUBLE his_y; // history[time]=x , the x at the "time", history[time] = -1. not exist
int size;
int get_groupnum(linklist *entry);
};
#endif
[解决办法]
STL的东西需要注意加上using namespace std;
或者std::stack <double>