C语言uint8_t和char的区别,c – int8_t和uint8_t是char类型吗?

鉴于这个C 11计划,我应该期待看到一个数字还是一个字母?还是没有期望?

#include

#include

int main()

{

int8_t i = 65;

std::cout << i;

}

标准是否指定此类型是否可以是字符类型?

解决方法:

根据C 0x FDIS(N3290)的§18.4.1[cstdint.syn],int8_t是一个可选的typedef,其指定如下:

namespace std {

typedef signed integer type int8_t; // optional

//...

} // namespace std

§3.9.1[basic.fundamental]陈述:

There are five standard signed integer types: “signed char”, “short int”, “int”, “long int”, and “long long int”. In this list, each type provides at least as much storage as those preceding it in the list. There may also be implementation-defined extended signed integer types. The standard and extended signed integer types are collectively called signed integer types.

Types bool, char, char16_t, char32_t, wchar_t, and the

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值