I didn't know what to call it - so I gave the title a fancy name
Anyway, I recall seeing a method in a c++ book where you could output a character x amount of times.
I know you can do
Code:
string z (10, '*');
cout << z << endl;
and you'll get **********.
Now say I don't have a string, just an int. How can i do something like
Code:
cout << (10, '*') << endl;
That code segment prints out *
How can I do that (so it'll print out 10 stars) or is a for loop required?
Any will be greatly appreciated,
Thanks in advance,
Matt