zoukankan      html  css  js  c++  java
  • 坑爹!

    读到0x1A时,fread就认为结束!

    今天调到的bug,以解决

    unsigned int16 范围是从0-65535 十六进制是 0X0000 - 0XFFFF 
    int16 范围是 -32768-32767 负数以补码方式储存 

    对一个整数的补码再求补码,等于该整数自身。

    补码 = 反码+1

    -5的原码(10000101)→符号位不变(10000101)→数值位取反(11111010)→加1(11111011)
    所以-5的补码是11111011
     
    原码 有符号的类型以最高位为符号位,1为负,0为正
     
     
     
     
     
    unsigned int t = 2147483680

    内存中是
    t
    0x80000020  
    1000 0000 0000 0000 0000 0000 0010 0000
    符号位不变 取反

    1111 1111 1111 1111 1111 1111 1101 1111
    除符号位
    111 1111 1111 1111 1111 1111 1101 1111
    2147483615
    加一
    2147483616
    111 1111 1111 1111 1111 1111 1110 0000
    得补码
    1111 1111 1111 1111 1111 1111 1110 0000
    signed int t = -2147483616
     
    conclusion:-2147483616 is in the C memory with the form of its completion code:1000 0000 0000 0000 0000 0000 0010 0000
     
    int - short int 16
       - long int 32
    int 16 or 32 depends on compiler
     
    char = (unsigned)char
     
    int,short, long signed
     
     
     
     
     
     
    const int * u; //指向const int 的指针
    int const * u; //同上
    int * const u; //指向int的指针 
    int const * const u; //指向const 对象的const 指针
    const int * const u; //同上
  • 相关阅读:
    python3.6中 字典类型和字符串类型互相转换的方法
    "sorted()"中的"Key Functions"
    tuple unpacking
    理解"__repr__"
    Python中的"Special Method"
    abstractmethod
    JavaScript括号中什么什么不加引号什么时候加引号?
    加载网页时速度慢的一些知识点
    Login登录页面的制作流程(摘要)
    JavaScript总结1
  • 原文地址:https://www.cnblogs.com/faeriesoft/p/4192771.html
Copyright © 2011-2022 走看看