If you know how to work with a char array then a boolean array is just the same except that all the values are true or false. Where exactly are you stuck?
JamesCherrill
Posting Genius
6,370 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
What are you using as the index of the array? I'd use the character's integer value - but what do you do if you have a repeated character?
jon.kiparsky
Posting Virtuoso
1,849 posts since Jun 2010
Reputation Points: 383
Solved Threads: 187
I'm afraid I don't understand your logic here. Maybe you could explain in English what you're trying to do with this, and what you want to do next.
jon.kiparsky
Posting Virtuoso
1,849 posts since Jun 2010
Reputation Points: 383
Solved Threads: 187
Whether the use of the boolean array is right depends on what is the algorithm you are implementing. There's no clue as to your intended algorithm, so no way for anyone to comment.
Do you have a written description of the algorithm? Do you have it in your head? Could you use it with pencil & paper if someone gave you an arbitrary word?
If you can't answer "yes" to at least one of those questions then it's too soon to be coding anything.
ps: The obvious way to do this involves recursion, but there are bound to be other ways as well.
Again! Hi Jon.
JamesCherrill
Posting Genius
6,370 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073