How to produce 64 bit masks?

Posted by egiakoum1984 on Stack Overflow See other posts from Stack Overflow or by egiakoum1984
Published on 2010-03-16T09:26:27Z Indexed on 2010/03/16 9:36 UTC
Read the original article Hit count: 256

Filed under:
|
|
|

Based on the following simple program the bitwise left shit operator works only for 32 bits. Is it true?

#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;

    }

The output of the program:

Enter input:
30
536870912
536870912

Enter input:
62
536870912
536870912

How could I produce 64-bit masks?

© Stack Overflow or respective owner

Related posts about c++

Related posts about bitmask