Are you sure you are needing to use realloc, is this some realloc exercise? As calling this over and over for each new student roll to be entered is costly.
I would prefer you change over to strictly using an array for this and is much faster to insert.
Code:
StdInfo students[10];
...
do
{
printf ("Enter Roll of Student %d :\t", i);
scanf ("%d", &(students[i++].roll));
printf ("\n\nEnter another ? (1/0):\t");
scanf ("%d", &s);
}
while (s == 1);
Remove your realloc and any malloc calls, you do no need them then!
Then do double check that they have been inserted try something like this:
Code:
int z = 0;
for (; z < i; z++)
{
printf ("Students rolls are: student %d, roll = %d\n", z,
students[z].roll);
}