String

How to make a space character in string?
What do you mean by "space character"? You can just append " " to a string if you want a whitespace...
Last edited on
you can just write: std::string space = " " /* Blank space */

if that's what you mean...
If you mean inserting a white space then:
1
2
3
string str = "helloworld";
str.insert(str.begin() + 5, ' ');
// str is now "hello world" 

Topic archived. No new replies allowed.