CString类型转为char数组
2010-09-24 20:47
274 查看
方法一:
char *p;
CString str="hello";
p=str.GetBuffer(str.GetLength());
str.ReleaseBuffer();
方法二:
CString str="hello";
char ch[20];
memcpy(ch,str,str.GetLength());
方法三:
char *ch;
CString str="hello";
ch=(LPSTR)(LPCTSTR)str;
char *p;
CString str="hello";
p=str.GetBuffer(str.GetLength());
str.ReleaseBuffer();
方法二:
CString str="hello";
char ch[20];
memcpy(ch,str,str.GetLength());
方法三:
char *ch;
CString str="hello";
ch=(LPSTR)(LPCTSTR)str;
相关文章推荐
- 怎样把CString类型转为char数组
- CString(LPCTSTR)转为VARTYPE类型
- MFC把CString类型转为char*型
- 数据类型CString转为string
- js 字符串类型转为数组类型
- CString string char等字符类型的相关知识和转换
- 转载:一篇关于CString类型转换的文章
- CString类型(字符串)转换成字符字组
- 8. String to Integer (atoi) 字符串转为int类型的所有可能情况
- C# “string格式的日期时间字符串转为DateTime类型”的方法
- 将MFC的CString 类型转化为C++标准数据类型std::string
- 【转】将ORACLE数据库表中字段的varchar类型转为CLOB?
- MySql 时间类型转为字符串
- vc++ Format 用法总结~~CString类型与其它数据类型相互转换
- 将String类型转为int类型
- javabean实体类对象转为Map类型对象的方法
- C#语言之“string格式的日期时间字符串转为DateTime类型”的方法
- Java 将数字转为16进制,然后转为字符串类型
- c++将基本类型转为字符串写入文件
- mysql中Tinyint(1)数据格式自动转为boolean类型