首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

底下程序为什么输出?呢。

2013-09-06 
下面程序为什么输出??呢。。。。#include stdafx.hint _tmain(int argc, _TCHAR* argv[]){char name[7]

下面程序为什么输出??呢。。。。
#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
char name[7] = "张小明";
//printf("%s\n",name);
char name_f = name[0];
char name_t = name[1];
printf("%c,%c\n",name_f,name_t);
return 0;
}

[解决办法]
自己在环境里打印下不就知道了么?
这个一个汉字两个字节,拆分了而已,看看对应环境的编码,
找找对应的映射表就知道了

热点排行