char **query; query = (char**) malloc ( sizeof(char*) ); int f=0; int i=0,j=0,c; while((c=getchar())!=EOF) { if(!isalpha(c)) continue; if(
The Return key doesn't produce EOF that's why the condition getchar() != EOF doesn't recognize it. You can do it by Pressing CTRL+Z in Windows or CTRL+D in Unix.
getchar() != EOF