Unsigned keyword in C++

后端 未结 5 1541
醉酒成梦
醉酒成梦 2020-12-02 08:38

Does the unsigned keyword default to a specific data type in C++? I am trying to write a function for a class for the prototype:

unsigned Rotate(unsigned ob         


        
5条回答
  •  有刺的猬
    2020-12-02 09:08

    Integer Types:

    short            -> signed short
    signed short
    unsigned short
    int              -> signed int
    signed int
    unsigned int
    signed           -> signed int
    unsigned         -> unsigned int
    long             -> signed long
    signed long
    unsigned long
    

    Be careful of char:

    char  (is signed or unsigned depending on the implmentation)
    signed char
    unsigned char
    

提交回复
热议问题