February 14th, 2003, 04:04 AM
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.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!