How to include especial characters in a string?

I want to format text using html tags but I can't figure out how to include special characters in a string.

1
2
3
4
std::string preHtmlTags = "<html><head/><body><p><span style=" font-size:14pt; color:#234eda;">";  
std::string postHtmlTags = "</span></p></body></html>";

return preHtmlTags +  lblText + postHtmlTags;


the code above produce 3 errors :

error: stray '#' in program
error: exponent has no digits
error: expected ',' or ';' before 'font'

Use the double-quote escape sequence (\") to insert double-quotes:

std::string string = "My name is \"foo\".";
Last edited on
Topic archived. No new replies allowed.