QUOTE(William_Wilson @ 15 Mar, 2007 - 06:55 PM)

the logic is a little a miss, if you draw this out:
temp.next -> rear.next -> temp (which is a circle not a linked list)
*this could work, except this is all you ever get, adding another element will simply replace rear and temp in the same pattern.
How are you trying to implement this as a cycle, or as a linked list with a null on the end to terminate?
Also a little more code, such as the function declaration and the node struct would help.
Wow. I wasn't trying to use a circular list. Here is the struct for the node and the function prototype.
CODE
class node
{
public:
int data;
node* next;
node( int x, node *a )
{
data = x;
next = a;
}
};
void Enqueue( int );
So, am I not updating the right node each time it enqueues?