Hello,
I am working on the last peice of my final for my C++ class. I understand the rules about helping with homework, so this is really just a question. If I wanted to find out if my char array[] had all the same character's in the array, what would be the best method for attempting this type of thing.
So, example:
char array [];
user enters: aaaa
how then, should I proceed to find if all the characters are the same letter?
I have tried a strcpy and comparison, but obviously that failed as when the user inputted: final
char array[0] = f was the same as char copy[0] = f
so my logic is off. Any suggestions or hints?
Thanks,
Julie
I am working on the last peice of my final for my C++ class. I understand the rules about helping with homework, so this is really just a question. If I wanted to find out if my char array[] had all the same character's in the array, what would be the best method for attempting this type of thing.
So, example:
char array [];
user enters: aaaa
how then, should I proceed to find if all the characters are the same letter?
I have tried a strcpy and comparison, but obviously that failed as when the user inputted: final
char array[0] = f was the same as char copy[0] = f
so my logic is off. Any suggestions or hints?
Thanks,
Julie
Comment