Hi.I'm trying to compile a program using dev c++
here is the program:
#include <iostream>
#include "stack.h"
using namespace std;
int main()
{
Stack s;
char charValue;
cout<<"Insert a char value:";
for (int i = 1;i <= 6;i++)
{ cin.get(charValue);
s.push(charValue);
}
cout<<s.pop();
cout<<s.pop();
cout<<s.pop();
cin.get(charValue);
s.push(charValue);
cout<<s.stackTop();
return 0;
}
the error is:
#include <iostream>
#include "stack.h"
using namespace std;
int main()
{
Stack s;
char charValue;
cout<<"Insert a char value:";
for (int i = 1;i <= 6;i++)
{ cin.get(charValue);
s.push(charValue);
}
cout<<s.pop();
cout<<s.pop();
cout<<s.pop();
cin.get(charValue);
s.push(charValue);
cout<<s.stackTop();
return 0;
}
#include <iostream>
#include "stack.h"
using namespace std;
int main()
{
Stack s;
char charValue;
cout<<"Insert a char value:";
for (int i = 1;i <= 6;i++)
{ cin.get(charValue);
s.push(charValue);
}
cout<<s.pop();
cout<<s.pop();
cout<<s.pop();
cin.get(charValue);
s.push(charValue);
cout<<s.stackTop();
return 0;
}
the error msg is:
1.Stack undeclared(first used in this function)
2.s undeclared.
Hope someone can help me to check what is wrong with this program.Thanks.
Last edited on
i tried using
#include<stack.h>
but still the same error msg.
3 main entry-points?could explain which one u r referring to.
i really need help to adjust this program to make it run.please give me some idea.
The STL header for stack is <stack>. Is that maybe what you wanted?