In response to Hike34's thread to add a \ character to a CString, I think the \ character has a meaning in such strings and to use it in a string it should itself be preceded by a \ character

CString word="hello world";
word+="\"; // or "'\'" doesn't work...

Instead of doing as above, do it like this

word +="\\" and you would have word= "hello world\".

Nkamanyi Clement

Recommended Answers

All 3 Replies

why are you responding to a year-old thread??:eek: :eek: I doubt the OP is interested in it any more.

OOPs I didn't notice it was that old.

why are you responding to a year-old thread??:eek: :eek: I doubt the OP is interested in it any more.

I am closing this thread since it was opened reagarding a two year old query by someone.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.