As per suggestions I have modified the code,
but how can I initialize single element in the structure ??
#include<stdio.h>
typedef struct student
{
int roll_id[10];
int name_id[10];
} student;
int main()
{
student p = { {0} }; // if i want to initialize single element ''FIX HERE, PLs''
student *pptr=&p;
pptr->roll_id[9]={0}; // here is the error pointed
printf (" %d\n", pptr->roll_id[7]);
return 0;
}
{0}is valid only as an aggregate (array orstruct) initializer.What you seem to want is to initialize
pof typestruct student. That is done with a nested initializer.