Hi there guys. I'm having trouble with my c++ program, just wondering if anyone here can give me a little help? It's a program for testing for palindromes. I keep on getting the error: C:\adkfj\asdfa.cpp(30) : error C2676: binary '&&' : 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' does not define this operator or a conversion to a type acceptable to the predefined operator
where it is bolded in the program:
thanks for any help guys.
#include < iostream >
#include < string >
#include < stdio.h >
using namespace std;
char uppercase(char c);
bool character(char c);
void main()
{
string palindrome;
string s;
int left = 0;
int right = s.size() - 1;
cout << " Input your work or phrase or 'stop' "<< endl;
cin >> palindrome;
palindrome = true;
while (palindrome && left<= right)
{
if (upperase (s[left++])!=uppercase(s[right--])
palindrome=false;
else
palindrome= true;
}
void getLine(string& s)
{
char c;
s = "";
c = getchar();
while ( c >= '')
{
s += c;
c = getchar();
}
char uppercase(char c);
{
if (c >='a' && c <='z')
return (c -32);
else
return c;
}
bool character(char c)
{
if ((c >= 'a' && c <= 'z')
||
(c >= 'A' && c <= 'Z')
||
( c >='0' && c < = '9' ))
return true;
else
return false;
}
}
cout << endl << " Input your work or pharse or 'stop' " << endl;
cin >> palindrome;
}
}
where it is bolded in the program:
thanks for any help guys.
#include < iostream >
#include < string >
#include < stdio.h >
using namespace std;
char uppercase(char c);
bool character(char c);
void main()
{
string palindrome;
string s;
int left = 0;
int right = s.size() - 1;
cout << " Input your work or phrase or 'stop' "<< endl;
cin >> palindrome;
palindrome = true;
while (palindrome && left<= right)
{
if (upperase (s[left++])!=uppercase(s[right--])
palindrome=false;
else
palindrome= true;
}
void getLine(string& s)
{
char c;
s = "";
c = getchar();
while ( c >= '')
{
s += c;
c = getchar();
}
char uppercase(char c);
{
if (c >='a' && c <='z')
return (c -32);
else
return c;
}
bool character(char c)
{
if ((c >= 'a' && c <= 'z')
||
(c >= 'A' && c <= 'Z')
||
( c >='0' && c < = '9' ))
return true;
else
return false;
}
}
cout << endl << " Input your work or pharse or 'stop' " << endl;
cin >> palindrome;
}
}