Check whether two strings are anagrams

Given two strings, check whether one string is an anagram / permutation of another string



#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
   char *s,*v;
   int hashs[26],hashv[26];
   int flag=1,i;
   s=(char*)malloc(sizeof(char));
   v=(char*)malloc(sizeof(char));
   memset(hashs,0,sizeof(hashs));
   memset(hashv,0,sizeof(hashv));
   scanf("%s",s);
   scanf("%s",v);
   for(i=0;*(s+i);i++)
    hashs[*(s+i)-'a']++;
   for(i=0;*(v+i);i++)
    hashv[*(v+i)-'a']++;
   for(i=0;i<26;i++)
   {
     if(hashs[i]!=hashv[i])
     {
      flag=0;
      break;
     }
   }
   if(flag)
    printf("anagrams");
   else
    printf("not anagrams");
   return 0;
}