I need to create a string of blanks in c++, where the number of spaces is a variable, so I can't just type it in. How do I do this without looping ?
Thanks!
size_t size = 5; // size_t is similar to unsigned int ‡ std::string blanks(size, ' '); See: http://www.cplusplus.com/reference/string/string/string/
‡ See the question on size_t if this isn't clear.
* - it looks like a pointer ;)