Outputting 'x' number of whitespaces...

In my program I am calculating a value for x and then I need the program to output that number of whitespaces but I'm not sure how to do this. I have tried a lot of variations and can't seem to find anything online...what I have now is:

int x=39-amountd.size();
cout << x, ' ';

But it isn't recognizing that x is the a mount of whitespaces I want to output it's simply outputting the number assigned to x. If anybody can help me iwth formatting of this would be great thanks!
You could use cout << string(x, ' '); instead, or some other methods (setw(), fill_n(), etc)
Topic archived. No new replies allowed.