use*_*167 2 c++ 64-bit bitmask bit-shift
基于以下简单程序,按位左移运算符仅适用于32位.这是真的吗?
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(void)
{
long long currentTrafficTypeValueDec;
int input;
cout << "Enter input:" << endl;
cin >> input;
currentTrafficTypeValueDec = 1 << (input - 1);
cout << currentTrafficTypeValueDec << endl;
cout << (1 << (input - 1)) << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
该计划的输出:
Enter input:
30
536870912
536870912
Enter input:
62
536870912
536870912
Run Code Online (Sandbox Code Playgroud)
我怎么能生产64位掩码?
归档时间: |
|
查看次数: |
3131 次 |
最近记录: |