struct node{
char a[100];
struct node* next;
};
typedef struct node* nodeptr;
main()
{
char b[100];
nodeptr p;
int n;
printf("enter the string\n");
scanf("%s",b);
n=strlen(b);
p=getnode();
p->a=b;
p->next=null;
printf("%s \n",(q->a));
return 0;
}
How can I access the array inside the struct using a struct pointer? Is this the correct method? I am getting the following error during compilation:
incompatible types when assigning to type ‘char[100]’ from type ‘char *’ "