So pretty much all I have to do is put a "-" between any double vowels that are in the word that I input into the array. So far I am able to get the word spread out to where it needs to be without the dash in the middle of the vowels. I just can't find a way to put them in now.
Example:
Text inputted: heeeeellllooooo
result: he e e e ellllo o o o o
except in the middle of the vowels when I print the result, it shows a character I'm not familiar with. its not a space. Sorry if you are confused by what I'm trying to do. Thank you for any input.
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
usingnamespace std;
void main()
{
int i, z;
i = 0;
char text[100],resulttext[120];
constchar text1 = '-';
cout << "Please enter any text here: ";
cin >> text;
for (int ii = 0; ii < 120; ii++)
{
int z = ii + i;
if (text[ii] == 'a')
{
if (text[ii + 1] == 'a') // checks for an 'a' in the array
{
i = i + 1;
}
}
if (text[ii] == 'u') // checks for an 'u' in the array
{
if (text[ii + 1] == 'u')
{
//resulttext[ii] = text1;
i = i + 1;
}
}
if (text[ii] == 'e') // checks for an 'e' in the array
{
if (text[ii + 1] == 'e')
{
//resulttext[ii] == text1;
i = i + 1;
}
}
if (text[ii] == 'i') // checks for an 'i' in the array
{
if (text[ii + 1] == 'i')
{
//resulttext[ii] == text1;
i = i + 1;
}
}
if (text[ii] == 'o') // checks for an 'o' in the array
{
if (text[ii + 1] == 'o')
{
//resulttext[ii] == text1;
i = i + 1;
}
}
resulttext[z] = text[ii];
}
cout << resulttext << endl;
}