Generating all 6-digit palindrome numbers in C++
I have checked your "brute force" algorithm and though it solves the problem (I have not run it to check), it will have to deal with a lot of work. Why not narrowing the problem a bit? What do we know about palindroms? They read the same from left to right than from right to left.

So if we use that and the fact that our palindroms are six digits long, we would only have to generate all the combinations for the first three digits, then make sure the next three are the same reversed. So:

for( int iter=100; iter&lt;=999; iter++ ) {
  stringstream ss;
  ss &lt;&lt; iter;
  string pal1 = ss.str();
  string pal2 = pal1;
  reverse(pal2.begin(), pal2.end());

  cout &lt;&lt; pal1 &lt;&lt; pal2 &lt;&lt; endl;
}