hi everyone, this is my first post, so bear with me.
this is driving me insane. im trying to write a program for Project Euler problem 4. here is the code that is giving me problems (its not complete yet)
/* A palindromic number reads the same both ways.
* The largest palindrome made from the product
* of two 2-digit numbers is 9009 = 91 × 99.
*
* Find the largest palindrome made from
* the product of two 3-digit numbers.
*
*/
#include <iostream>
#include <sstream>
#include <string.h>
usingnamespace std;
bool isPalindrome(int number)
{
string check;
stringstream out;
out << number;
check = out.str();
for (int position = 0; position < (check.length/2); position++)
{
if (check.at(position) == check.at(check.length - position))
{
returnfalse;
}
}
returntrue;
}
int main()
{
isPalindrome(1234);
return 0;
}
and the errors are
/home/nick/Euler/Euler004/main.cpp||In function ‘bool isPalindrome(int)’:|
/home/nick/Euler/Euler004/main.cpp|23|error: invalid use of member (did you forget the ‘&’ ?)|
/home/nick/Euler/Euler004/main.cpp|25|error: invalid use of member (did you forget the ‘&’ ?)|
||=== Build finished: 2 errors, 0 warnings ===|
what exactly does this error message mean and how do i fix it?