What is wrong in this code

#include
using namespace std;
class node{
public:
int data;
nodenext;
node(int d){
data=d;
next=NULL;
}
};
void insertathead(node
&head,int data){
noden=new node(data);
n->next=NULL;
head=n;
}
void print(node
&head){

while(head!=NULL){
    cout<<head->data;
    head=head->next;
}

}
int main() {
node*head=NULL;
insertathead(head,5);
insertathead(head,4);
insertathead(head,3);
insertathead(head,2);
print(head);

}
it give output only 2 why not 2345

send the link of code
save it at ide.codingblocks.com

here is the mistake
correct one is
n->next=head;
head=n