基于以下简单程序,按位左移运算符仅适用于 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;
}
程序的输出:
Enter input:
30
536870912
536870912
Enter input:
62
536870912
536870912
如何制作 64 位掩码?