I am new this site. It has been about 8 years since I last written any code so I am a bit rusty.
I am trying to write a program in C++ that scans through the line and replaces each of the blank characters with a dash character, then passes it to the thread and converts the first lower case letter to upper case.
for (int i=0;i <convert1.dash(' ');
if (convert1[i]==' ')
convert1[i]='_';
}
{
char convert2[MAX_LENGTH];
bool cap_it = true;
std::cout << "Write a sentence and the first letter of each word will be capitalized for you and all spaces will be replaced with a dash.\n";
std::cin.getline(convert1, convert2, MAX_LENGTH);
for (int i = 0; i < strlen(convert1, convert2); i++)
{
if (isalpha(convert2[i]) && cap_it == true)
{
convert2[i] = toupper(convert2[i]);
cap_it = false;
}
else
if (isspace (convert2[i]))
cap_it = true;
}