Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
skill_tree_c
提交
75d9da19
S
skill_tree_c
项目概览
CSDN 技术社区
/
skill_tree_c
通知
24
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skill_tree_c
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
“2ddef137fe6ee84ce7d1af9f6e3807cd90d276fa”上不存在“...gserver/git@gitcode.net:paddlepaddle/PaddleDetection.git”
提交
75d9da19
编写于
10月 23, 2021
作者:
F
feilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add bit op
上级
5d06581f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
70 addition
and
2 deletion
+70
-2
data/3.C语言高阶/3.位运算/5.位逻辑运算符/bit_op.json
data/3.C语言高阶/3.位运算/5.位逻辑运算符/bit_op.json
+6
-0
data/3.C语言高阶/3.位运算/5.位逻辑运算符/bit_op.md
data/3.C语言高阶/3.位运算/5.位逻辑运算符/bit_op.md
+59
-0
data/3.C语言高阶/3.位运算/5.位逻辑运算符/config.json
data/3.C语言高阶/3.位运算/5.位逻辑运算符/config.json
+4
-1
data/3.C语言高阶/3.位运算/7.位字段/bit_field.md
data/3.C语言高阶/3.位运算/7.位字段/bit_field.md
+1
-1
未找到文件。
data/3.C语言高阶/3.位运算/5.位逻辑运算符/bit_op.json
0 → 100644
浏览文件 @
75d9da19
{
"type"
:
"code_options"
,
"author"
:
"幻灰龙"
,
"source"
:
"bit_op.md"
}
\ No newline at end of file
data/3.C语言高阶/3.位运算/5.位逻辑运算符/bit_op.md
0 → 100644
浏览文件 @
75d9da19
# 位逻辑运算
下列错误的代码是?
## 答案
```
c
#include <stdio.h>
#include <assert.h>
int
main
(
int
argc
,
char
**
argv
){
int
i
=
1
;
assert
(
i
<<
1
==
4
);
return
0
;
}
```
## 选项
### 选项1
```
c
#include <stdio.h>
#include <assert.h>
int
main
(
int
argc
,
char
**
argv
){
int
i
=
2
;
assert
(
i
>>
1
==
1
);
return
0
;
}
```
### 选项2
```
c
#include <stdio.h>
#include <assert.h>
int
main
(
int
argc
,
char
**
argv
){
int
i
=
3
;
assert
((
i
&
2
)
==
2
);
return
0
;
}
```
### 选项3
```
c
#include <stdio.h>
#include <assert.h>
int
main
(
int
argc
,
char
**
argv
){
int
i
=
1
;
assert
((
i
|
2
)
==
3
);
return
0
;
}
```
\ No newline at end of file
data/3.C语言高阶/3.位运算/5.位逻辑运算符/config.json
浏览文件 @
75d9da19
...
...
@@ -6,5 +6,7 @@
"C语言"
],
"children"
:
[],
"export"
:
[]
"export"
:
[
"bit_op.json"
]
}
\ No newline at end of file
data/3.C语言高阶/3.位运算/7.位字段/bit_field.md
浏览文件 @
75d9da19
#
十六进制转换
#
位字段(bit filed)
利用位域,你能声明比字符宽度更小的成员,低至1位。假设机器字是8 bytes,下面的结构体大小是?
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录