include <iostream>

using namespace std;

class Lists{
void insert_head(int insert);
void remove_head();
void insert_tail(int insert);
void print();
Node *head;
Node *tail;

struct Node{
int data;
Node *link;

int main()
Lists temp;

return 0;


head = new Node;

void Lists::insert_head(int insert){
Node *temp;
head->link=temp; //add new Node,

void Lists::insert_tail(int insert){
Node *temp;

void Lists::print(){
Node *current=head;
cout << current->data << endl;

void Lists::remove_head(){
Node *temp=head->link;
delete temp;

What is the problem you are facing.?
Please give further detail.

commented: After 5 months, do you really think he cares now? +0

Also, please put your code in code blocks so it is properly indented. It is very hard to read as-is.

Seeing as this thread is 5 months old, I guess replying to this is pretty much pointless. But seeing as umesh and Rubberman have resurrected it, I figured "what the heck?!". There are a few obvious errors in the code that I can see (other than the lack of code tags and indentation). So here goes:

  1. The 'Node' structure should be declared before the 'Lists' class.
    Because 'Node' is a member of the 'Lists' class, the compiler will need Node to be declared/defined before the 'Lists' class, otherwise it will throw errors about 'Node' being undefined.

  2. The 'tail' member of the 'Lists' class should be initialised in the class constructor.
    As the OPs code stands, the lists 'tail' member is completely uninitialised. So the call to temp.print() in main() will almost certainly cause a segfault/crash at runtime when it attempts to access the tail of the list.

  3. In the 'Lists' class constructor, it should be noted that the 'Node' structure doesn't have a member called 'Link', but it does have a member called 'link'. So the lines 'head->Link=tail;' and 'tail->Link=NULL;' should be edited appropriately.

  4. In the main function the call to 'system("PAUSE")' should be made before the return statement, not after it! In fact if you want to be completely anal about it, system("PAUSE") should not be used at all. But whatever floats the OP's boat!

There may well be other problems/errors in the OP's code, but the four problems listed above stuck out instantly!