【新人强化培训】c 语言强化练习1 ：类型转换 和 最大值c 语言强化练习1 ：类型转换 和 最大值

`#include <stdio.h>#include <stdlib.h>#define INT_MAX ((int)(~0U>>1))#define INT_MIN (-INT_MAX - 1)#define UINT_MAX (~0U)#define LONG_MAX ((long)(~0UL>>1))#define LONG_MIN (-LONG_MAX - 1)#define ULONG_MAX (~0UL)#define LLONG_MAX ((long long)(~0ULL>>1))#define LLONG_MIN (-LLONG_MAX - 1)#define ULLONG_MAX (~0ULL)int main(void){        unsigned long long ll1 = 0;        unsigned int ii = 0;        unsigned char cc = 0;        unsigned char mul = 2;        //ii = (1<<32)-1;        //ii = 4294967295;         ii = (~0U);        printf("ii=%u\n",ii);         ll1 = (unsigned long long)ii * mul; //KERNEL 里面有一些很大的数 ，尤其要注意。         //ll1 = (unsigned long long)(ii * mul); //这个就是错误的， 溢出了。 自己试试,得到的value就是0 了。         //ll1 = (unsigned long long)(ii *2); //error ,overlow        //ll = ii *2;//the same above         cc = ii; //only get the low 8 bits        printf("ll1=%llu\n",ll1);        printf("cc=%u\n",cc);        printf("cc=%hhu\n",cc); //the result is same to above        printf("LONG_MAX=%ld, hex type=%#08lx\n",LONG_MAX,LONG_MAX);        printf("ULONG_MAX=%lu , hex type=%#08lx\n",ULONG_MAX,ULONG_MAX);        printf("ULLONG_MAX=%llu , hex type=%#08llx\n",ULLONG_MAX,ULLONG_MAX);        return 0;}`