Hi, I have the following code:

Code:
    ostringstream temp;
    
    for(int i=2; i<x; i++)
    {
            if((x%i)==0) {
                         hasFactors=1;
                         temp << i ;
                         output += temp.str(); 
            }
    }
.

It is designed to factorise the number x and display all the factors in the variable 'output'.

But there is a trouble. Say 12 was the number for instance.

You would expect output (which is a string btw) to equal "2346". Instead it equals

"2 23 234 2346" without the spaces (I added them for clarity). Is there a way that I can get the effect that I want.

Thanks in advance,
mintsmike.