C++ String: What types of strings are there?

Q: What types of strings are there?

A:

  • 'char*' -> this is also called a C-style string, or an ANSI string.

  • 'wchar_t*' -> this is wide character string, i.e. an 'unsigned short*'

  • 'CString' -> this is a string wrapper class, which is part of the Microsoft Foundation Classes (MFC).

  • 'std::string' -> this is a Standard C++ Class wrapping a char string. It is part of the Standard Template Library, or STL.

  • 'std::wstring' -> this is a Standard C++ Class wrapping a wchar_t string. It is part of the Standard Template Library, or STL.

  • 'BSTR' -> this known as basic string or binary string, and is a pointer to a wide character string used by Automation data manipulation functions.

Note: Most of the material in this article is taken from codeguru.com


Recommended Reading :





Renegade Motorhomes - Vegas Hotel - Loan - Phoenix Pools