السلام عليكم
أرجو مساعدتي في اكتشاف الخطأفي هذا الكود
#include<iostream.h>
#include<string.h>
#include<stdlib.h>
struct emp
{int no;
char name[10];
struct emp *next;};
typedef struct emp *ptr;
typedef ptr list;
emp *insert-to-front(list s,int num,char name[10])
{cout<<"enter the name and the num in the list" ;
cin>>num>>name;
emp *p;
p=(emp*)malloc(sizeof(emp));
p->no=num;
strcpy(p->name,name);
p->next=1;
1=p;
return 1;}
void traverse(list head)
{emp *p1=head;
while(p1!=null){
cout<<p->no<<"\t"<<p1->name<<endl;
p1=p1->next;}}
void main(){
int n;
char name[10];
cout<<"enter the num and name";
cin>>n>>name;
struct emp* head;
head=(emp *p)malloc(sizeof(struct emp));
struct emp *p=head;
p->no=n;
strcpy(p->name,name);
p->next=null;
cout<<"list before insert: "<<endl;
traverse(head);
head=insert-to-front(head,n,name);
cout<<"list after insert: "<<endl;
traverse(head);
}إذا حاولت تطبيق البرنامج تظهر لي رساله
declartion syntax error

