well i realy tryed to solve it
this is what i thought of but i just dont know what to do next
so any one can help me and tell me what to do next
i mean i dont know what to fork
can any one help me please
#include <iostream>
void push (char input);
bool IsFull (void);
bool IsEmpty (void);
void pop (void);
void history (void);
using namespace ::std;
char input;
int max=10;
int front=-1;
char *queue;
int rear=-1;
void main(){
cin>> input;
while(input != 'e')
{
if(input=='h'){
push(input);
history();
}
}
if(input=='e')
cout<<"exit"<<endl;
}
void push (char input) {
if (IsFull())
{
pop();
queue[++rear]=input;
}
else
queue[++rear]=input;
}
void pop (void){
if (IsEmpty())
cout<<"Is Empty"<<endl;
else
queue[++front];
}
bool IsFull (void){
if (rear==max-1 && front==-1)
return true;
else
return false;
}
bool IsEmpty (void){
if (rear== front)
return true;
else
return false;
}
void history (void){
while (!IsEmpty())
{
cout<<queue[rear]<<endl;
rear--;
}
}
