Hi Doc,
I have a few suggestions:
1. Initialize Guess. You shouldn't try to use uninitialized variables - and while we're at it, I'll remind you again to enable warnings in your compiler - using uninitialized variables should cause a warning.
Make sure you initialize all other variables before using them (note: here, by "use" I mean "read" from them, test them; if you first write to them before any use, then you don't need to initialize them).
2. You are right, you cannot compare two char arrays to figure out if two strings are identical. Use strcmp instead (man strcmp).
3. Hard to read unindented code (I'm assuming it's because of the way the post gets formatted by the board), but I'm not sure what this line does:
myChosenWordEasy[MAXWORDLENGTHEASY];
in the context:
for (i=0;i<MAXWORDLENGTHEASY-1;i++)
flag[i] = false;
myChosenWordEasy[MAXWORDLENGTHEASY];
length = MAXWORDLENGTHEASY-1;
Is that an incompletely pasted line ? The code shouldn't even compile with a line like that, as far as I can tell.
-----------
I really don't understand the second half of your post, so I can't make any comments on that.
hope this helps a bit.
Bookmarks