-
problem w/ header
hey, i can't get this to go. a little help . . . thanks
Code:
#include <iostream.h>
class c_sequence
{
protected:
int back;
int data[10];
public:
c_sequence();
virtual mf_poke(char ch);
virtual mf_pop(void)=0;
virtual mf_peek(void)=0;
};
c_sequence::c_sequence()
{
back=0;
}
void c_sequence::mf_poke(char ch) //error:not a member
{
if (back<0)
{
data[back]=ch;
back++;
cout<<endl;
}
else
cout<<"sorry, stack full"<<endl<<endl; //error should return a value
}
-
>virtual mf_poke(char ch);
changed to
virtual void mf_poke(char ch);
equals no more errors :)
Any method that isn't a constructor or destructor must return a value, even it it's void.
-Prelude