here are my two classes: #ifndef ISTACK_H #define ISTACK_H template class IStack
ID: 3564189 • Letter: H
Question
here are my two classes:
#ifndef ISTACK_H
#define ISTACK_H
template
class IStack
{
public:
virtual bool isEmpty() const = 0;
virtual void push(const T& val) = 0;
virtual void pop() = 0;
virtual const T& top() const = 0;
};
#endif
--------------------------------------
#ifndef LISTSTACK_H
#define LISTSTACK_H
#include "IStack.h"
template
struct StackItem
{
T value;
StackItem *next;
};
template
class ListStack: public virtual IStack
{
public:
private:
};
#endif
when i try to compile these two classe, i always get an error saying expected class-name before
Explanation / Answer
Replace
#include "IStack.h"
with
class IStack;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.