#include<stdio.h>
int main() {
typedef unsigned long priority_type;
static const priority_type LOWEST_PRIORITY = ~0UL; //0为unsinged long类型,并且每位取反,下同。试下~,把%lu改为%ld再试下~
static const priority_type LOW_PRIORITY = 1UL << 24;
static const priority_type NORMAL_PRIORITY = 1UL << 16;
static const priority_type HIGH_PRIORITY = 1UL << 8;
static const priority_type HIGHEST_PRIORITY = 0;
printf("LOWEST_PRIORITY=%lu, LOW_PRIORITY=%lu, NORMAL_PRIORITY=%lu, HIGH_PRIORITY=%lu, HIGHEST_PRIORITY=%lu\n",
LOWEST_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY, HIGH_PRIORITY, HIGHEST_PRIORITY);
return 0;
}
unsigned long的一点应用
最新推荐文章于 2024-01-21 19:42:00 发布