Dev c++

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
closed account (zb0S216C)
#include "stack.h"

Is this a user-defined header or a standard header?

Why do you have 3 main entry-points?
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.
closed account (zb0S216C)
i tried using
#include<stack.h>

No, it's not what I asked. Is Stack.h a header that you created?

3 main entry-points?could explain which one u r referring to.

All of them. Why have you posted 3 main entry-points? You only need one.
The STL header for stack is <stack>. Is that maybe what you wanted?
Topic archived. No new replies allowed.