常用数据类型 位数

注:编译运行环境 gcc 、64 bit linux

总结:

unsigned char

 8 bit0-255   CV_8U
char  8 bit-128-127
unsigned short16 bit0-65535  CV_16U
short 16 bit-32768-32767 (0-2^15-1)
int 32 bit 
long64 bit 
float32 bitCV_32F
double32bitCV_64F
int main()
{
  unsigned char a=256;
  char b=128;
  unsigned short c=65536;
  short d=65536/2;
  int e=5;
  long f=4;
  long int g=4;
  long long  h=4;
  float i=2.3434;
  double j=2.32424;
  
  printf("unsigned char is %d byte\t%d\n",sizeof(a),a);
  printf("char is %d byte\t%d\n",sizeof(b),b);
  printf("unsigned short is %d byte\t%d\n",sizeof(c),c);
  printf("short is %d byte\t%d\n",sizeof(d),d);
  printf("int is %d byte\n ",sizeof(e));
  printf("long is %d byte\n",sizeof(f));
  printf("long int is %d byte\n",sizeof(g));
  printf("long long  is %d byte\n",sizeof(h));
  printf("float is %d \n",sizeof(i));
  printf("double is %d \n",sizeof(j));
  
  return 0;
}

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值