okay, so i'm totally new to this.
the purpose of my assignment is to compare two strings and to see if they're anagrams
my problem is that when i run it, it compiles okay, but then i'd get a message from windows, saying that it has stopped working.
er, yeah. i've no clue whats wrong, so any help would be appreciated.
thanks!
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
char *string1[100000], *string2[100000];
int a, b, c, count1[27], count2[27], m, no;
int main () {
for (m=0; m<=26; m++){
count1[m]=0;
count2[m]=0;
}
gets(*string1);
gets(*string2);
for (a=0; a<=strlen(*string1); a++){
if (isalpha(*string1[a]))
count1[*string1[a]]++;
}
for (b=0; b<=strlen(*string2); b++){
if (isalpha(*string2[b]))
count2[*string2[b]]--;
}
for (c=0; c<=26; c++){
if (count1[c]+count2[c]!=0)
no++;
}
if (no==0)
printf("YES\n");
else
printf("NO\n");
system("pause");
return 0;
}