Error: assignment makes integer from pointer without a cast
..i want to build an student database using linked list and in c language...but i am unable to create nodes for each variable like age,name,...i did not post the entire program but the concept is in the code...plzzz help..just tell me how should i bulid a student database using singly linked list
#include<stdio.h>
struct node
{
int data;
char value[20];
struct node *next;
};
typedef struct marksheet
{
int physics;
int chemistry;
int maths;
int biology;
int IP;
}mark;
typedef struct stu
{
char name[20];
int age;
int rollno;
char address[20];
char city[20];
int zipcode;
mark marks;
}students;
void create(struct node **,int);
void display() ;
students student[30];
int main()
{
struct node *p;
p=NULL;
int ch,n;
printf("\n\n\t****Welcome to Student database **********\n");
printf("1.Create an account\n2.Dsiplay the student accounts\n3.exit\n");
printf("\nPlease enter your choice:\n");
scanf("%d",&ch);
{
case 1:
printf("Enter the no of student Entry you wanna create:");
fflush(stdin);
scanf("%d",n);
create(&p,n);
break;
case 2:
display(&p);
break;
case 3:
exit(0);
break;
}
return(0);
}
void create(struct node **p,int n)
{
int i;
struct node *age;
struct node *name;
for(i=0;i<n;i++)
{
printf("\nEnter your name:");
scanf("%d",student[i].name);
name=(struct node*)malloc(sizeof(struct node));
name->data=student[i].name;
name->next=NULL;
printf("\nEnter your age:");
scanf("%d",&student[i].age);
age=(struct node*)malloc(sizeof(struct node));
age->data=student[i].age;
name->next=age;
age->next=NULL;
}
}
78,1 75%
1,1 To
void display(int n)
{
int i;
for(i=0;i<n;i++)
{
printf("name:%s",student[i].name);
printf("age:%d",student[i].age);
}}