how would I use set fill to repeat a string. like "%_"

Sep 26, 2013 at 5:56pm
how would I use set fill to repeat a string. like "%_"
1
2
    cout << setfill ('%_') << setw (35);


my IDE is complaining about the above line of code.
Sep 26, 2013 at 6:06pm
closed account (o3hC5Di1)
Hi there,

could you be a little bit more specific as to what your IDE complains about?
Are you getting a compiler error, if so, which?

Also, setfill() takes a char as an argument. char is a type which has only place for one single character, so '%_' does not fit that description.

Hope that helps.

All the best,
NwN
Last edited on Sep 26, 2013 at 6:08pm
Topic archived. No new replies allowed.