How to convert CString to std::string in Visual Studio 2005

There are many methods available. But the easiest one in VS 2005 is to use the function CStringA. See the following code snippet.

   CString CStr("This is a CString");
   std::string Str = CStringA(CStr);
CStringA is a template specialization of class CStringT.
Advertisements

2 Responses to How to convert CString to std::string in Visual Studio 2005

  1. […] My Experiments with C++ Sharing my ideas « How to convert CString to std::string in Visual Studio 2005 […]

  2. […] Click to see how to convert CString to std::string […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: