I know Google Spreadsheets has something like this
=REPT("|",100)
Is there something like that C++ has?
If you just want a single character repeated n times, then a
std::string
would do.
1 2 3 4 5 6 7
|
#include <iostream>
#include <string>
int main()
{
std::cout << std::string (100, '|');
}
|
Last edited on
char reps[101] = {0};
memset(reps, '|', 100);
only works on byte sized stuff though. Not very useful in general.
Last edited on