I need to make a string program that would determine if a string has all unique character. So when i enter any sentence, it will decided if there are any repeated letters in the sentence.
I know i need to use getline() for string to read and i need to use erase function to remove all the space in the string
Below is what i got so far and i need help improving it.
#include <iostream>
#include <sting>
usingnamespace std;
int main()
{
bool isUnique(string);
int main(){
bool uniq;
string a;
cout << "Please input a string, not a very long one...."<< endl;
getline(cin, a);
uniq = isUnique(a);
if (uniq == true)
{
cout << "The string has no repeatations." <<endl;
}else{
cout << "The characters in the string are not unique." <<endl;
}
return EXIT_SUCCESS;
}
please don't declare a function in main or might be a typo since I can see you got 2 main functions , correct that.
Also where is its definition. .. please provide