Skip to content

Instantly share code, notes, and snippets.

@ex
Created November 4, 2012 04:59
Show Gist options
  • Save ex/4010386 to your computer and use it in GitHub Desktop.
Save ex/4010386 to your computer and use it in GitHub Desktop.
Bug bitwise operators precedence explanation
info->is_directory =
file_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY != 0;
info->is_directory =
file_info.dwFileAttributes & (0x00000010 != 0);
info->is_directory =
file_info.dwFileAttributes & (true);
info->is_directory =
file_info.dwFileAttributes & 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment