国产18禁黄网站免费观看,99爱在线精品免费观看,粉嫩metart人体欣赏,99久久99精品久久久久久,6080亚洲人久久精品

2017年計(jì)算機(jī)等級考試二級C++輔導(dǎo):stringwstring_bstr_t的互相轉(zhuǎn)換

時(shí)間:2017-06-08 15:25:00   來源:無憂考網(wǎng)     [字體: ]

  今天在研究VC++ 使用 ADO 讀取MS SQKSERVER 數(shù)據(jù)庫時(shí), 發(fā)現(xiàn):

  string ansi字符串

  wstring unicode字符串

  _bstr_t com字符串

  之間的轉(zhuǎn)換關(guān)系,示例如下:

  // ex_02_wstring_cv_string.cpp : 定義控制臺應(yīng)用程序的入口點(diǎn)。

  //

  #include "stdafx.h"

  #include "string"

  #include "icrsint.h"

  #include "comutil.h"

  using namespace std;

  #import "C:\\Program Files\\Common Files\\System\\ADO\\msado15.dll" no_namespace rename("EOF", "EndOfFile")

  int _tmain(int argc, _TCHAR* argv[])

  {

  CoInitialize(NULL);

  wstring ws1,ws2;

  ws2 = L"春如舊,人空瘦,淚痕紅浥鮫綃透。桃花落,閑池閣,山盟雖在,錦書難托。莫、莫、莫。";