64,646
社区成员
发帖
与我相关
我的任务
分享
#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;
}
cout<<int(unsigned char (c))<<endl;
#include <stdio.h>
#include <math.h>
void main()
{
char c=-1;
cout << ((unsigned int)c&0xff) << endl;
}
cout<<dec<<(unsigned char)c;