Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with C Programming assignment
#19
fawrh Wrote:something that may be of use is you need to make sure that you are carful with initalizeing the strings that you pass into your functions, if they are not, the for loop conditions may never fail as the data in of the string may not be 0 therefor it will continue to iterate. This may also be a bad thing if someone types in 0 in the string, as sting[i] will == 0 therefor the for loop will break. As far as your break statement goes, it is eaiser to use a bool and set it to false, then break with an if([I]boo) break;

Just some food for thought... Error handleing is your friend.

i know, thats why the boolean expressions are [i] == '\0', which is the void statement for strings.

and @ devil's sunrise, even if a subsequence isnt necessarily and substring, it matters not. The test is to figure out if the word is in the dictionary.txt file, spelled correctly. If it isnt i'm to offer suggestions that either make it a matchscore less then 3 with same wordlength, a permutation with same wordlength, or subsequence or a substring with wordlength within 2. If it would test true for substring, then even if i deleted that test completely it would still test true for subsequence, making it somewhat unnecessary.

But the sorting the permutations seems like not a bad idea, just think there is a somewhat easier way, but since i can't figure out how to do loops to test correctly, i suppose that's a workaround i can try.
Reply


Messages In This Thread
Need help with C Programming assignment - by Fiel - 2009-11-23, 09:18 PM
Need help with C Programming assignment - by Fiel - 2009-11-23, 09:22 PM
Need help with C Programming assignment - by Fiel - 2009-11-25, 08:13 AM
Need help with C Programming assignment - by Fiel - 2009-11-25, 11:51 AM
Need help with C Programming assignment - by Sivrat - 2009-11-25, 11:32 PM

Forum Jump:


Users browsing this thread: