Dear Martin
Now I am giving my modified code here.
After that I described about my algo . If you find any missconception about my algo please let me know it.
ALGORITHM:
1. First I took total input in a twoD ara then copy it in a structure ara
2. Then I sorted the structure by qsort
3. Then I took a word from the queri and search it in the sorted structure
If I succeed then print that it's a correct word. Otherwise checked the word for misspell, in the following procedure.
5. Start at the beginning of the twoD ara for the same length word, if it found then check for their adjacency if ok then return the index number.
6. Otherwise check for one character wrong if ok then return the index number of the word.
7. If the len of the word in the ara which come first is more than the queri word and the difference between their len is 1 then check it for extra character if I found that then I return
8. If the len of the word in the ara which come first is less than the queri word and the difference between their len is 1 then check it for miss character if I found that then I return
9. If one of them not heppened than I returned -1 so that I can print unknown
Detail of my algo you will find in code.
Mushfiqur Rahman