c++ - ':' 在结构字段声明中是什么意思?
问题描述
今天,我在这个网站上看到了一个对我来说很新的例子。提供的示例如下:
struct S {
char a; // memory location #1
int b : 5; // memory location #2
int c : 11, // memory location #2 (continued)
: 0,
d : 8; // memory location #3
struct {
int ee : 8; // memory location #4
} e;
} obj; // The object 'obj' consists of 4 separate memory locations
我对这个例子中的 ':' 有点困惑,“int b : 5;”是什么意思?在这个例子中是什么意思?
解决方案
推荐阅读
- javascript - JavaScript 中的热链接
- javascript - 如何为 react-router Link 的执行 onClick 功能设置超时?
- jquery - 从标签中获取内容
- c - 使用 -std=c11 标志编译部分代码
- php - haveRaw 不能在 laravel 的分页中工作
- chef-infra - 检查厨师食谱中是否存在文件/目录的最简洁方法是什么?
- python - 将表单添加到 Dash/Plotly 应用程序
- javascript - 获取每次添加的新数据的 id
- python - 如何使用 FacetGrid 显示一些选定的行
- autodesk-forge - Autodesk Forge Viewer three.min.js 找不到错误