Inputing a link list

hello,after watching video,i made same code for inputting a link list but ,…my code is taking input only,it is not printing the linked list.
here the code is:
#include
using namespace std;
class node{
public:
int data;
node* next;
node(int d)
{
data =d;
next=NULL;
}
};
void insertathead(node*&head,int data)
{
node*n=new node(data);
n->next = head;
head=n;
}

void print(nodehead)
{
node
temp=head;
while(temp!=NULL)
{
cout<data<<"-> ";
temp= temp->next;
}
}
void insertionattail(node*&head,int data)
{

if(head==NULL)
{
	node*temp=new node(data);
	return;
}
node*tail=head;
while(tail->next!=NULL)
{
	tail=tail->next;	
}
tail->next=new node(data);
return;

}
int length(node*head)
{
int len=0;
while(head!=NULL)
{
head=head->next;
len++;
}
return len;
}

void insertioninmiddle(node*&head,int data, int p)
{
if(head==NULL||p==0)
{
insertathead(head, data);
}
else if(p>length(head))
{
insertionattail(head,data);
}
else
{
//insertion in the middle
//take p-1 jumps
int jump=1;
nodetemp=head;
while(jump<=p-1)
{temp=temp->next;
jump++;
}
node
n=new node(data);
n->next=temp->next;
temp->next=n;

}

}

void builtlist(node*&head)
{
int data;//taking first data
cin>>data;
while(data!=-1)
{
insertionattail(head,data);
cin>>data;
}
}
int main()
{
node*head = NULL;
builtlist(head);
print(head);
return 0;
}

In your code where is along with #include and in print function write node *head

// i corrected…but again this code is not working…it is taking input and as soon as i give -1,it terminates and //no output is coming.thank you
#include
using namespace std;
class node{
public:
int data;
node* next;
node(int d)
{
data =d;
next=NULL;
}
};
void insertathead(node*&head,int data)
{
node*n=new node(data);
n->next = head;
head=n;
}

void print(nodehead)
{
node
temp=head;
while(temp!=NULL)
{
cout<data<<"-> ";
temp= temp->next;
}
}
void insertionattail(node*&head,int data)
{

if(head==NULL)
{
	node*temp=new node(data);
	return;
}
node*tail=head;
while(tail->next!=NULL)
{
	tail=tail->next;	
}
tail->next=new node(data);
return;

}
int length(node*head)
{
int len=0;
while(head!=NULL)
{
head=head->next;
len++;
}
return len;
}

void insertioninmiddle(node*&head,int data, int p)
{
if(head==NULL||p==0)
{
insertathead(head, data);
}
else if(p>length(head))
{
insertionattail(head,data);
}
else
{
//insertion in the middle
//take p-1 jumps
int jump=1;
nodetemp=head;
while(jump<=p-1)
{temp=temp->next;
jump++;
}
node
n=new node(data);
n->next=temp->next;
temp->next=n;

}

}

void builtlist(node*&head)
{
int data;//taking first data
cin>>data;
while(data!=-1)
{
insertionattail(head,data);
cin>>data;
}
}
int main()
{
node*head = NULL;
builtlist(head);
print(head);
return 0;
}

Bro give me the url of codingblocks ide or pls put ur updated code here