
-----------------------------------
HeavenAgain
Tue Feb 27, 2007 11:32 pm

comparing 2 strings
-----------------------------------
umm this is a question straight from the junior question for the CCC
is called anagram checker
instructions are : 
input : the program should prompt the user for two phrases, each entered on a separate line. you may assume that the input only contains upper case letters and spaces.
output: the program will print out one of the two statements :"is an anagram" or is not an anagram

example would be "TIME" and "ITEM" or "CS AT WATERLOO" and "COOL AS WET ART"
those 2 would be anagram, i'm assuming the spaces doesnt matter.

i thought about this question and i used a hash map to solved it. but is there any other ways?

-----------------------------------
Martin
Wed Feb 28, 2007 12:39 am

RE:comparing 2 strings
-----------------------------------
Something like this:


string word = "...";
string anag = "...";
int letters[26] = {0};
for( int i=0;i