Hi,
The following part of code is failling at first free call (Line no.26) giving above error.I don't know what to do.Please reply urgently.
int main()
{
val1 Valstruct;
int i;
Valstruct.ch = (char **)malloc(2 * sizeof(char *));
for(i=0 ; i<2 ; i++)
{
Valstruct.ch[i] = (char *)malloc(10 * sizeof(char));
Valstruct.ch[i] = "Anand";
printf("\n String is %s",Valstruct.ch[i]);
}
for(i=0 ; i<2 ; i++)
{
free(Valstruct.ch[i]);
}
free(Valstruct.ch);
return 0;
}