0

I am programing in MFC .NET, and I am encountering a problum in adding the symbol '\' to a CString object. This is naturaly due to the fact that the symbol is used for such things as \n \t ect.

How do I go about it?

say I have the following code:

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

Cheers,
Hike

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by clemente
0

Another reply solue due to the fact that goole desktop for some reason wants to propagate these questions now and then...

I wanna say RTFM, but I can include the escape the escape hint... Use \\ for a literar \ in C/C++/Java/(Just about any other application that uses \ escapes for special characters).

/pern.*/i

0

I am programing in MFC .NET, and I am encountering a problum in adding the symbol '\' to a CString object. This is naturaly due to the fact that the symbol is used for such things as \n \t ect.

How do I go about it?

say I have the following code:

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

Cheers,
Hike

*********************************************************

I think you could do it this way
word+=_T("\");

Nkamanyi Clement

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.