Definitions of: AnsiString, WideString, String, char[], char*, BSTR,

偶尔善良 提交于 2019-12-10 11:38:02

问题


This is a followup to this question

AnsiString is a class, too? And string? It is a class? And a char[]?

Can we say a WideString is a wrapper over double-byte characters, AnsiString is a wrapper over single-byte characters, and char[] is an array of single-byte characters? string not so sure what it is...

Not sure about the diferent kind of string types I have in Code Builder C++ 2007 available and its portability.


回答1:


  • AnsiString is a class provided C++ Builder,
  • std::string is class provided by the C++ standard library,
  • char [] creates an array of the type of character,
  • char * creates a pointer to the type character,
  • BSTR is a Windows COM specific string class.

AnsiString and BSTR are non portable, while std::string, char [] and char* are completely portable.



来源:https://stackoverflow.com/questions/9463018/definitions-of-ansistring-widestring-string-char-char-bstr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!