segmentation fault
- by gcc
int num_arrays;
char *p[20];
char tempc;
int i=0;
do
{ p[i]=malloc(sizeof(int));
scanf("%s",p[i]);
tempc=p[i];
++i;
}while(tempc=='x');
num_arrays=atoi(p[0]);
When i write num_arrays=atoi(..),gcc give me segmentation fault or memory
stack is exceeded, I don't understand why it behaves like that
can anyone explain, why?