一般C++标准库中的string不支持宽字节,也就是unicode字符集。 所以要想将TCHAR或wchar转换成string,则需调用系统函数WideCharToMultiByte int len = WideCharToMultiByte(CP_ACP, 0, *s, -1, NULL, 0,
分类:
编程语言 时间:
2016-03-11 17:04:59
阅读次数:
180
1 #include<windows.h> 2 //通用字符串的定义头文件 3 #include<tchar.h> 4 5 6 7 //消息回调函数 8 LRESULT CALLBACK WindowProc( 9 HWND hWnd, //窗口句柄 10 UINT uMsg, //消息ID 11
#include "stdafx.h" #include <stdio.h> #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { int a[5] = {0,2,5,7,8}; int b[5] = {1,3,4,6,9}; int
分类:
编程语言 时间:
2016-03-01 22:22:41
阅读次数:
251
#include "stdafx.h" #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { //建立一个16行5列的数组 int **p = new int*[16];//分配堆内存16个 int* for(int...
分类:
编程语言 时间:
2016-02-13 23:11:21
阅读次数:
205
//---------------------------------------------------------------------------
#pragmahdrstop
#include<tchar.h>
#include<iostream>
//---------------------------------------------------------------------------
#pragmaargsused
#defineDATATYPEin..
分类:
编程语言 时间:
2016-02-02 23:26:52
阅读次数:
337
1 char* UnicodeToAnsi(TCHAR* wstr) //转换字符编码 2 { 3 if( !wstr ) 4 return NULL; 5 6 int strlen = ::WideCharToMultiByte(CP_ACP, NULL, wstr, wcslen(wstr),
分类:
其他好文 时间:
2016-01-28 20:45:46
阅读次数:
127
acedGetString()[ads_getstring()]int acedGetString(int cronly, const TCHAR *prompt, TCHAR *psz)acedGetString()函数暂停程序运行以等待用户输入一个字符串,其定义如下:该函数使result指向用户...
分类:
其他好文 时间:
2016-01-25 12:59:04
阅读次数:
226
#include "stdafx.h"#includeint _tmain(int argc, _TCHAR* argv[]){ //动态内存的分配,必须清楚的是,分配后返回的必然是一个地址,即一个指针 //动态内存分配,第二点必须要说明分配大小,分配类型应该与返回类型一致 //第三点,动态内存,由...
分类:
其他好文 时间:
2016-01-14 12:06:37
阅读次数:
134
查看OpenGL版本信息 执行如下代码 1 #include "stdafx.h" 2 #include 3 #include 4 5 int _tmain(int argc, _TCHAR* argv[]) 6 { 7 glutInit(&argc, (char**)argv)...
分类:
其他好文 时间:
2016-01-13 23:22:17
阅读次数:
146
链表添加元素,然后插入、删除、最后遍历#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ list staff; staff.pus...
分类:
其他好文 时间:
2015-12-29 16:15:01
阅读次数:
157