In the following program, i am expecting the for loop to stop after 3 elements. But it keeps on going indefinitely and fails later on with a coredump.
mal
for(i=0;strcmp("",str[i])!=0;i++)
You do dereference the unitialized pointer
for(i=0;str[i];i++)
But it will not work as this
memset(str,0,10);
Does not initialize the whole array
memset(str,0,10*sizeof(char *);