知行合一

享受过程 漠视结果

导航

c语言基本数据类型及存储方式

    char    a1 = 101;
    char    a2 = 102;
    short   a3 = 103;
    short   a4 = 104;
    int     a5 = 105;
    int     a6 = 106;
    long    a7 = 107;
    long    a8 = 108;
    float   a9 = 109.23;
    float   a10 = 111.23;
    double  a11 = 113.113;
    double  a12 = 115.113;
    
    char    *b1 = &a1;
    char    *b2 = &a2;
    short   *b3 = &a3;
    short   *b4 = &a4;
    int     *b5 = &a5;
    int     *b6 = &a6;
    long    *b7 = &a7;
    long    *b8 = &a8;
    float   *b9 = &a9;
    float   *b10 = &a10;
    double  *b11 = &a11;
    double  *b12 = &a12;

    //char 1 short 2 int 4 long 4 float 4 double 8
    printf("%x|%x|%x|%x|%x|%x|%x|%x|%x|%x|%x|%x|\n",b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12);
    char *p=b1;
    int i;
    for(i=0;i<46;i++){
        printf("%x|",*p++);
    }
    //bece9af2|bece9af3|bece9af4|bece9af6|bece9af8|bece9afc|bece9b00|bece9b04|bece9b08|bece9b0c|bece9b10|bece9b18|
    //65|66|67|0|68|0|69|0|0|0|6a|0|0|0|6b|0|0|0|6c|0|0|0|c3|75|da|42|c3|75|de|42|ac|1c|5a|64|3b|47|5c|40|ac|1c|5a|64|3b|c7|5c|40|

 

posted on 2015-03-25 10:22  项羽  阅读(1424)  评论(0编辑  收藏  举报