void readtext(){ FILE *f; int i=0; int num_text=0; char a; int i_text=0; int acount_text=0; //acount the num of char and row f=fopen(name,"r+"); a=fgetc(f); for(;a!=EOF;){ if(a=='\n'){ i++; } num_text++; a=fgetc(f); } fclose(f); row_text=i; //write the text to [] text=(char *)malloc(sizeof(char)*(num_text+1)); ana_text=(int *)malloc(sizeof(int)*(row_text+1)); f=fopen(name,"r+"); a=fgetc(f); for(i=0;i