2011年8月24日
摘要: 转自:http://msdn.microsoft.com/en-us/library/ms235631%28VS.80%29.aspxThis topic demonstrates how to convert various Visual C++ string types into other strings. The strings types that are covered include char *, wchar_t*, _bstr_t, CComBSTR, CString, basic_string, and System.String. In all cases, a c... 阅读全文
posted @ 2011-08-24 15:09 风在竹林 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 转自: http://www.diybl.com/course/3_program/c++/cppjs/200856/114832.html【规则】 1、string为普通类型,不是数组型,只是其内容为字符串; 2、’a’和”a”的区别:’a’为字符,”a”为字符串;单引号只能定义一个字符,双引号可以定义多个字符,即字符串。 3、指针可以通过加减、自加减改变其值,数组不可以。 4、以数组定义的字符串可以修改其中的字符,以指针定义的字符串不能修改其中的字符。 例如: char a[]=”hello”; cout<<a; //输出 hello cout<<*(a+1); / 阅读全文
posted @ 2011-08-24 02:00 风在竹林 阅读(582) 评论(0) 推荐(0) 编辑
摘要: 转自:http://blog.chinaunix.net/space.php?uid=21411227&do=blog&cuid=21579431.字符指针可以指向一个字符串。 我们可以用字符串常量对字符指针进行初始化。例如,有说明语句: char *str = "This is a string."; 是对字符指针进行初始化。此时,字符指针指向的是一个字符串常量的首地址,即指向字符串的首地址。 这里要注意字符指针与字符数组之间的区别。例如,有说明语句: char string[ ]="This is a string."; 此时,str 阅读全文
posted @ 2011-08-24 01:38 风在竹林 阅读(777) 评论(0) 推荐(0) 编辑
摘要: 转自:http://forums.devx.com/archive/index.php/t-86391.html---------------------------------------------------------------------1楼------------------------------------------------------------------------ How can I convert a char array to a BSTR variable? I have tried using the SysAllocString() functio.. 阅读全文
posted @ 2011-08-24 01:00 风在竹林 阅读(306) 评论(0) 推荐(0) 编辑