I'm getting the segmentation fault error for the inner while loop.
char **c;
c=(char **)malloc(3*(N-1)*sizeof(char *));
for(int i=0;i<3*(N-1);)
{
char *temp;
gets(temp);
while(*temp!='$')
{
j=0;
while(*temp!=' ')
{
*(c[i]+j)=*(temp+j);
j++;
}
i++;
}
i++;
}
sorry for improper indentation.I know that manipulating char * strings would cause an error.But I am not sure about this error.I was tring to break tmp string into three different strings.