Quick actions

cmd+k|ctrl+k

Navigation

Languages

Bit manipulation / Bit Manipulation Application Small to Capital Letter / Essential C++

Snippet info

Language

Cpp

Visibility

public

Author

kkowalczyk

Created

2019-03-27T06:44:26Z

Updated

2019-03-27T06:44:26Z

#include <cstdio>

int main()
{
    char op1 = 'a';  // "a" letter (i.e. small case)
    int mask = 0xDF; // choosing a proper mask

    printf("a (AND) mask = A\n");
    printf("%c   &   0xDF = %c\n", op1, op1 & mask);
    
    return 0;
}
INFO