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.

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

  1. How to Convert string to Number « My Experiments with C++ Says:

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

  2. How To Convert a Number To std::string « My Experiments with C++ Says:

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

Leave a Reply