C++ String: What is the difference between 'CString' and std::string'?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: C++ String: What is the difference between 'CString' and std::string'?

Threaded View

  1. #1
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443

    C++ String: What is the difference between 'CString' and 'std::string'?

    Q: What is the difference between 'CString' and 'std::string'?

    A: 'CString' is a MFC class and can be used only for Windows programs that are statically or dynamically linked to the MFC. Use 'CString' when you write MFC programs.

    'std::string' is a Standard C++ class - in other words, it is part of the C++ programming language. It is a very powerful class that can be used in any kind of Windows programs (MFC, Win32, Win32 Console) as well as in non-Windows programs.

    'CString' and 'std::string' can be mixed, if you know what you are doing and you take some precautions.


    Last edited by Andreas Masur; July 24th, 2005 at 07:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center