您的程序必须包含删除所有
元音和确定字符是否为元音的函数。我不断收到此错误
main.cpp:43:19: 错误:没有可行的重载 '=' novwels[100] = remove(name[100]); * * * * * */
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void remove(string name);
bool check(string letter);
int main()
{
string novowels[100];
string name[100];
cout << "Please insert a string: ";
getline(cin, name[100]);
novowels[100] = remove(name[100]); //ERROR IS HERE!!!
cout << "\n This is your string without vowels homie:\n " << novowels;
return 0;
}
string remove(string name[100]) {
int j = 0;
bool trueorfalse;
string novowels[100];
for (int i = 0; i < 99; i++) {
trueorfalse = check(name[i]);
if (trueorfalse == false) {
novowels[j] = name[i];
j++;
} else if (trueorfalse == true) {
} else {
break;
}
}
return novowels[100];
}
bool check(string letter) {
if (letter == "a" || letter == "e" || letter == "i" || letter == "o" || letter == "u" || letter == "A" || letter == "E" || letter == "I" || letter == "O" || letter == "U") {
return true;
} else {
return false;
}
}