wchar_t,char,cout,wcout

//#include

include”iostream”

include”tchar.h”

include”windows.h”

include”cstring”

using namespace std;

int main()
{
wchar_t* strW = L”lishuyu”;
wchar_t* strW1 = NULL;
char* str = “lishuyu”;
strW1 = strW + wcslen(strW) - 3 ;

cout<<strW<<endl;
wcout<<strW<<endl;
cout<<str<<endl;
cout<<endl;

cout<<"wsclen(L\"lishuyu\") = "<<wcslen(strW)<<endl;
cout<<"strlen(\"lishuyu\") = "<<strlen(str)<<endl;
cout<<endl;

cout<<strW1<<endl;
wcout<<strW1<<endl;
cout<<endl;

int count =6;
BYTE* pByte = new BYTE[count];
for(int i=0;i<count;i++)
    pByte[i] = i+1;

cout<<"value of pByte(unsigned char):"<<endl;
for(int i=0;i<count;i++)
    cout<<"pByte["<<i<<"] = "<<pByte[i]<<endl;
cout<<endl;

cout<<"value of pByte(int):"<<endl;
for(int i=0;i<count;i++)
    cout<<"pByte["<<i<<"] = "<<(int)pByte[i]<<endl;
cout<<endl;

CHAR ch1 = 1,ch2 = '1';
cout<<"ch1 = "<<ch1<<endl;
cout<<"ch1 = "<<(int)ch1<<endl;
cout<<"ch2 = "<<ch2<<endl;
cout<<"ch2 = "<<(int)ch2<<endl;
cout<<endl;

WCHAR wch1 = 1,wch2 = '1';
wcout<<"wch1 = "<<wch1<<endl;
wcout<<"wch1 = "<<(int)wch1<<endl;
wcout<<"wch2 = "<<wch2<<endl;
wcout<<"wch2 = "<<(int)wch2<<endl;
cout<<endl;

TCHAR tch1 = 1,tch2 = '1';
cout<<"tch1 = "<<tch1<<endl;
cout<<"tch1 = "<<(int)tch1<<endl;
cout<<"tch2 = "<<tch2<<endl;
cout<<"tch2 = "<<(int)tch2<<endl;
cout<<endl;

system("pause");
return 0;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值