hey. i'm having trouble writting a push function for a queue. this is what i've got, in my head, it should work, but i'm not a computer.

struct queue
{
char charecter;
queue *next;
};

void push(queue* &top, char toPush)
{
queue *Temp;
queue *Traverser;
Temp = new queue;
Temp->charecter = toPush;
Temp->next = NULL;
if(top->next == NULL)
{
cout << "pushing to top";
top->charecter = toPush;
top->next = new queue; //this line seems to cause the error in visual c++ 6
}
else
{
for(Traverser = top ; Traverser->next != NULL ; Traverser = Traverser->next)
{
}
Traverser = Temp;
cout << "Qu char: " << Traverser->charecter << '\n';
}
}

the push function is what's giving me the trouble. the pop function works fine. i'll post it here incase anyone who helps needs it.

char pop(queue* &top)
{
char toReturn = top->charecter;
top = top->next;
return toReturn;
}

and here is my main

void main()
{
queue Qu;
Qu = new queue;
Qu->next = NULL;
push('a');
cout << pop(Qu);
}