I have a couple of comments. Let's start with this.
Code:
char *t=(char*)malloc(26 * sizeof(char));
As has already been discussed, the cast is something to avoid in C. It is a holdover from the pre-ANSI C days.
http://www.eskimo.com/~scs/C-faq/q7.7.html

So then we have the following.
Code:
char *t = malloc(26 * sizeof(char));
But it is useless to do sizeof(char) because it is always 1. So it could just as well be as follows.
Code:
char *t = malloc(26);
But I prefer the following instead.
Code:
char *t = malloc(26 * sizeof(*t));
Then if I need to change t to some other type, the code only needs to be changed in one spot.
Code:
long *t = malloc(26 * sizeof(*t));
Dwelling on this a little, I find that even sizeof(int) stands out as code to avoid. If you use sizeof on the object itself, you always get its correct size. If you use sizeof on the presumed type of an object, you will get the size of a presumed type -- which may or may not be the size of the object.

This may seem trivial for small amounts of code. But when project get bigger and changes are in multiple modules it can get confusing. I guess I just find it better to avoid the middleman and always be safe.