摘要: 在Windows编程中,经常会碰到字符串之间的转换,char*转LPCWSTR也是其中一个比较常见的转换。下面就列出几种比较常用的转换方法。 1、通过MultiByteToWideChar函数转换 MultiByteToWideChar函数是将多字节转换为宽字节的一个API函数,它的原型如下: LP 阅读全文
posted @ 2017-08-16 14:13 xuanyin 阅读(4078) 评论(0) 推荐(0) 编辑
摘要: #define __EXPORTS 1 #ifdef __cplusplus #ifdef __EXPORTS #define DLL_EXPORT extern "C" __declspec (dllexport) #else #define DLL_EXPORT extern "C" __declspec (dllimport) #endif #else #ifdef __EXPOR... 阅读全文
posted @ 2017-08-10 17:11 xuanyin 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 方式一:利用向导新建Qt Gui应用程序 方式二:纯代码编写Hello World程序 新建空Qt项目->新建main.cpp文件 方式三:利用命令行编译程序 在Qt的安装目录下C:\Qt新建helloworld文件夹,新建main.cpp文件,copy上述代码 利用Qt 4.8.5 Command 阅读全文
posted @ 2017-02-18 11:59 xuanyin 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 参考书籍:Qt Creator快速入门(第二版) 工具可以上Qt开源社区进行下载:http://www.qter.org/ Qt版本:4.8.5 Qt Creator版本:2.8.0 MinGW版本:GCC 4.4 具体安装及环境配置参见书籍 阅读全文
posted @ 2017-02-18 11:08 xuanyin 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 一、const应用1.const关键字,他后面内容的不可修改,一般来说,其修饰的变量不可再进行赋值操作;2.指針常量 int a = 3; int b = 4; const int* pt = &a; a = 5; *pt的值为5,pt只是一个指针,所以他指向的是a的内容,const限制的是*pt... 阅读全文
posted @ 2014-04-21 16:36 xuanyin 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 //通过首尾交换对字符串实现反转 6 char *revstr(char *str,size_t len) 7 { 8 char *start=str; 9 char *end=... 阅读全文
posted @ 2013-10-20 12:44 xuanyin 阅读(1005) 评论(0) 推荐(0) 编辑