Code:who knows why the while loop prints correctly while does not proceed to print with the for loop ??... char *aqq[30000]; while(fgets(c,sizeof(c),fq)!=NULL) { aqq[count]=c; count++; printf("%s listed---: ",&aqq[count]) } for(i=0;i<=count;i++) { printf("%s listed---: ",&aqq[i]); }