linked list nodes

I'm trying to create a linked list; so far my code is:

node *newnode=new node;
newnode->item=dataItem;
newnode->next=back;
back=newnode;
//front and back are =NULL;
so far it works, but I'm not sure how to set front to be the first node.
I've tried, but it prints the first node twice:

if(isEmpty())
{
front=newnode;
back=newnode;
newnode->next=NULL;
}
else
{
newnode->next=back;
back=newnode;
}
Thanks again for reading, hoping for feedback.
Topic archived. No new replies allowed.