C++ const char *轉string 和 string 轉const char *的一種方法
(認知有限,如有不妥,還請告知,歡迎討論)
輸出結果:

The type of "sample pkc" is PKc
The type of "sample str" is NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
The type of "beginning pkc" is PKc
The type of "beginning pkc" now is NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
The type of "beginning string" is NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
The type of "beginning string" now is PKc
=END=
標簽: