I am a c++ noob and I have been trying to figure out how you would pad out a line of string entered <30 char to a specific length set. I wanted to have one extra space added to each gap until the extra spaces run out max length 30 characters.
So if I have : cout << "Enter String" ;
cin << stringentered ;
I want it to loop through adding a space until it reaches 30 char.
It__is__a__sunny day.
It___is___a___sunny___day.
It____is____a_____sunny____day. = this is the display I want at the end of the loop which = 30 characters (the _ are blank spaces).