【发布时间】:2017-05-16 08:31:30
【问题描述】:
以下是我的代码编译器说 undefined reference to function 。请详细说明该怎么做。为什么它会给布尔函数 isPalindrome() 关于 undefined reference 的错误?
int main()
{
cout << "Please enter a string: ";
cin >> input;
cout<<"Vowel Count"<<vowelcount(input);
while(1)
{
if(isPalindrome())
{
palindrome_count++;
}
}
cout<<"palindrome_count"<<palindrome_count;
}
bool isPalindrome(string input)
{
do{
if (input == string(input.rbegin(), input.rend())) {
cout << input << " is a palindrome\n";
}
}
while(1);
}
【问题讨论】:
-
下次请发一个完整的程序。您在
main()之前省略了一些与问题相关的内容
标签: c++ function boolean undefined-reference