关于UNiCode的一个有关问题
关于UNiCode的一个问题
#define UNICODE
#include <windows.h>
#include <tchar.h>
int _tmain (int argc, LPTSTR argv [])
{
TCHAR a = '好 ';
printf( "%d\n ", sizeof(a));
}
我想问一下为什么如果#include <tchar.h> 放在#include <windows.h> 之前的话,得到的结果是1,而不是2.
------解决方案--------------------
上一楼说得没错,可是有一个问题编译时有下面一个WARNING:
warning C4305: '= ' : truncation from 'const int ' to 'char '
用printf() 怎么输出???
等你答案
#define UNICODE
#include <windows.h>
#include <tchar.h>
int _tmain (int argc, LPTSTR argv [])
{
TCHAR a = '好 ';
printf( "%d\n ", sizeof(a));
}
我想问一下为什么如果#include <tchar.h> 放在#include <windows.h> 之前的话,得到的结果是1,而不是2.
------解决方案--------------------
上一楼说得没错,可是有一个问题编译时有下面一个WARNING:
warning C4305: '= ' : truncation from 'const int ' to 'char '
用printf() 怎么输出???
等你答案