I found this code snippet on SO (sorry I don\'t have the link to the question/answer combo) bool isDir = (File.GetAttributes(source) & FileAttributes.Directory) == FileAttributes.Directory;
Sometimes I need to be sure that some integer is even. As such I coul开发者_Go百科d use the following code:
Ok for example, I am using bitwise like such: Monday = 1, Tuesday = 2, Wednesday = 4, Thursday = 8 etc...
0x7F000000 is 0111 1111 0000 0000 0000 0000 0000 0000 in 32 bit binary. 0x01000058 is 0000 0001 0000 0000 0000 0000 0101 1000.
long wxyz; //(w = bits 0-8, x = bits 9-17 , y = bits 18-23, z =bits 24-29) short w; short x;开发者_开发技巧
I\'ve been looking over some game programming code and have seen enums as in: [Flags] pub开发者_如何学Clic enum CollisionCategories
I have an attribute (32 bits-long), that each bit responsible to specific functionality. Perl script I\'m writing should turn on 4th bit, but save previous definitions of other bits.
Does anyone know if the 32-bit signed representation has been changed in Delphi XE? I have the following code, that works fine in Delphi 5:
I have a char pointer pointing to a char: char *a = \'A\'; And while doing a bitwise &: *a & 0x11
This question already has answers here: Closed 12 years ago. Possible Duplicates: How do you set, clear and toggle a single bit in C?