unsigned long的一点应用
2016-06-28 20:52
363 查看
#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; }
相关文章推荐
- session入库
- 为 Tomcat 安装 apr
- 吉布斯采样——原理及matlab实现
- Erasure Coding(纠删码)深入分析
- 算法之美--交换排序--冒泡排序
- Codeforces 545C Woodcutters
- SpiralOrderTraverse,螺旋遍历二叉树,利用两个栈
- BBC-unit7 session1
- 字符串分割,以及字符串匹配
- Visual Studio属性配置中使用宏
- out.println()和<%=%>那种输出方式更好?
- okHttp post&get请求
- Javassist library is missing in classpath! Please add missed dependency!
- android 实现截取 内容超过屏幕大小的长图
- windows7系统上查找大于指定大小的文件
- css position属性
- Linux系统安装 OpenSSL两种方法
- 列式存储和行式存储的区别
- Quartz教程五:SimpleTrigger
- python docx库使用样例