hey guys, so i get the "c incompatible types in assignment" error in the malloc line.
would someone please explain where i went wrong?
Thank you in advance.
#include <stdio.h>
#include <stdlib.h>
struct the_struct
{
char FirstName[20];
char LastName[32];
int Score[20];
};
int main ()
{
int i,n;
struct the_struct *ptr[100];
printf("how many students?");
scanf("%d",&n);
ptr=(int*)malloc(n*sizeof(int));
for (i=0;i<=n;i++);
printf("Enter First Name \n");
scanf("%s",ptr[i]->FirstName);
printf("Enter Last Name \n");
scanf("%s",ptr[i]->LastName);
printf("Enter Score? \n");
scanf("%s",ptr[i]->Score);
printf("%s %s %s\n",ptr[i]->FirstName,ptr[i]->LastName,ptr[i]->Score);
}