anagram - a word, phrase, or name formed by rearranging the letters of another, such as cinema, formed from iceman.                 
For this assignment you will write a program anagram.c
to find anagrams of words on the command line with words in a dictionary file using dynamic memory and qsort
. Your program will accept the name of the file and words to find on the command line as shown in the example below. Your program should print out the word and the sorted letters of that word on one line, followed by each anagram found in the dictionary on separate line.
                
% tail ~cs157/pub/words zymotic zymotically zymotize zymotoxic zymurgies zymurgy zythem zythum zyzzyva zyzzyvas % c11 -Wall anagram.c % ./a.out ~cs157/pub/words time cool react Matches for time (eimt): emit item mite time Matches for cool (cloo): cool loco Matches for react (acert): caret carte cater cerat crate creat creta ecart react recta trace %
We will test your program with various words in the dictionary.                 
qsort
before comparing them.
Use                 
~cs157/bin/checkin HW3 anagram.c
or web checkin                 
Modified: 2017-11-12T20:04                  User: Guest                  Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |