I'm trying to:
delete any word(-s) from a set of words which begins with 3 vowel letters in a row.
I've been doing this on Embarcadero RAD Studio XE using C++ builder and this should work like this: a set of words is entered to the text box and upon pushing a button, program should do the algorithm and print a result in a second text box.
Here's what I've got so far:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AnsiString text=Form1->Textbox1->Text;
int position=0, i=0;
char *str=text.c_str(), *space=" ",
*word=strtok(str,space), *word_array;
word_array=(char*)malloc(sizeof(char));
if (word_array==NULL) {
exit (0);
}
else
{
while (word!=NULL)
{
if (word.substr(i,i+3)!= //ERROR: Structure required on left side of . or .*
"AAA"||"aaa"||"EEE"||"eee"||
"III"||"iii"||"YYY"||"yyy"||
"OOO"||"ooo"||"UUU"||"uuu") {
word_array=(char*)realloc(word_array, strlen(word)*sizeof(char));
word_array[position]=*word;
position+=1;
}
word=strtok(NULL,space);
}
}
}
I am experiencing only one error in this line: if (word.substr(i,i+3)!=