I want a 20 character NULL('\0') terminating string filled with white spaces.
Currently I am doing it in following way
char foo[20];
for (i = 0; i < num_space_req; i++) //num_space_req < 20
{
foo[i] = ' ';
}
foo[num_space_req] = '\0';
Is there a better way for above?
std::fill (foo, foo + num_space_req, ' ');