void staircase(int n)
{
for(int i = 1 ; i <= n ; i++)
{
string h(i,'#');
string s(n-i,' ');
cout<<s<<h<<endl;
}}
Please explain the first two lines in the for loop. Can we declare like string h(i,'#');
in strings?
Does it means filling the i
th position in the string with "#"?