Initializing

How to initialize a declared string object to hold nine empty/blank spaces?
Last edited on
If you mean std::string then


std::string s( 9, ' ' );
If you mean a character array then

char s[] = " "; // there are 9 spaces.
Last edited on
Topic archived. No new replies allowed.