I'm a beginner at programming and I've never posted on here before. I've had a search for answers to my question and one such thread was here ...but I can't get their method to work.
I'm trying to learn C by doing some of the Project Euler challenges. For one of the challenges I need to check if a number is palindromic. I thought I'd do this by loading my target integer, called product, into an array before checking pairs of elements against each other (looking for symmetry).
First I check to see how long my product is:
productLength = ceil(log10(product));
Then I have a loop to try and load that integer into my array called inspection:
for(x = productLength; x <= 0; x--) //decrement from product length and loop
{
inspection[x - 1] = product % 10; //transfer product values to inspection array
product /= 10; //prepare product value for next pass (move digits one place to the right)
}
This doesn't seem to work. I'm aware it's probably some silly mistake but I can't spot it.