16,472
社区成员
发帖
与我相关
我的任务
分享
cout<<int(unsigned char(c))<<endl;
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <conio.h>
#include <windows.h>// 注意添加 才能使用byte
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char c = -1;
cout<<int(BYTE(c))<<endl; //255
getch();
return 0;
}
int main(int argc, char* argv[])
{
char c = -1;
cout<<int(byte(c))<<endl; //255
getch();
return 0;
}