I'm doing a data structure program where i write in a palidrome it puts it into a stack then into a queue then back to the stack and it also verifies that it is or isnt a palindrome what am i doing wrong
Code:
class Pali{
public:
Pali();
Pali(char str[]);
~Pali();
void instack();
void inqueue();
void outstack();
bool verify();
private:
stack<char>stackelems;
queue<char>queueelems;
stack<char>stackelems2;
CString char cstrelems[];}
Pali::Pali(){instack();};
Pali::Pali(char str[]){
strcpy(str,cstrelems);
instack();};
Pali::~Pali(){};
void Pali::instack(){
while(!stackelems.empty()){
cstrelems.push();}
inqueue();}
void Pali::inqueue(){
while(!queueelems.empty()){
stackelems.pop();
queueelems.push();}
outstack();}
void Pali::outstack(){
while(!stackelems2.empty()){
queueelems.pop();
stackelems2.push();}
if(verify()==true){
while(!stackelems2.empty()){
cout<<stackelems2.top();
stackelems2.pop();}
else{cout<<"This is not a palindrome!"<<endl;}}
cout<<"\n";}
bool Pali::verify(){
if((stackelems==stackelems2)==true){
return true;}
else
return false;
}
int main(){
char arr;
Pali sarr;
cout<<"Enter a palindrome: "<<endl;
cin>>arr;
sarr(arr);
return 0;}