当前位置:网站首页>c语言编程当中两个!!的作用
c语言编程当中两个!!的作用
2022-07-28 15:15:00 【酸菜。】
在一些内核模块的代码里面经常看到一个表达式里面用两个!!符号的,搜索了一下,其实
作用有两个,一个是非零值使用!!一个是0使用!!。
0没的说了,使用两次!!还是0,,那非0呢?比如1和12,-1等,它们使用两次以后都变成1。
int main(int argc, char **argv)
{
int i = 0, j = -1, x = 1, y = 12;
printf("i = %d, j = %d, x = %d, y = %d\n", !!i, !!j, !!x, !!y);
return 0;
}

边栏推荐
- 兆骑科创创新创业大赛人才引进平台,双创赛事高层次人才引进
- Proportional solenoid valve control valve 4-20mA to 0-165ma/330ma signal isolation amplifier
- Play dead prototype chain
- [live broadcast reservation] a new challenge under the evolution of data architecture - Shanghai railway station
- Solve the problem that the right-click menu "edit with idle" of the 『 py 』 file is invalid or missing
- Vm501 development kit development version single vibrating wire sensor acquisition module geotechnical engineering monitoring
- Is MySQL query limit 1000,10 as fast as limit 10? If I want to page, what should I do?
- Redis series 4: sentinel (sentinel mode) with high availability
- R语言使用GGally包的ggpairs函数可视化分组多变量的两两关系图、设置alpha参数改变图像透明度、对角线上连续变量密度图、离散变量条形图、两两关系图中包含散点图、直方图、箱图以及相关性数值
- Record Clearfix clear float
猜你喜欢

Solve the problem that the right-click menu "edit with idle" of the 『 py 』 file is invalid or missing

5-channel di/do relay output remote IO acquisition module Modbus tcp/ibf95

MLX90640 红外热成像仪测温传感器模块开发笔记(八)

2021 Kent interview question 2

Multifunctional mixed signal AI acquisition / switching value di/do acquisition to rs485/232/modbus module

js中的for循环总结

动态规划 --- 数位统计DP

JS priority queue

Why do most people who learn programming go to Shenzhen and Beijing?

2021 亚鸿笔试题
随机推荐
I'll show you a little chat! Summary of single merchant function modules
Notes on October 22, 2021
2021 Kent interview question 3
正大杯黑客马拉松数据解析竞赛
NTC, PT100 thermal resistance to 4-20mA temperature signal converter
The deep displacement monitoring system wk813 is used to measure the deep displacement of slopes, dams, embankments, railways and building foundation pit excavation
Detectron2 installation and testing
How to measure the vibrating wire sensor by vibrating wire acquisition module?
便携式钻孔测斜仪数据采集仪测量原理与测斜探头的连接及使用方法
【微信小程序开发(七)】订阅消息
A tour of grp:05 - GRP server streaming service end stream
2021 肯特面试题2
[live broadcast reservation] a new challenge under the evolution of data architecture - Shanghai railway station
IFD-x 微型红外成像仪(模块)的温度测量和成像精度
高精度绝对角度传感器应用高速度角度监测
Open light input / relay output rs485/232 remote data acquisition IO module ibf70
记录一下 clearfix 清除浮动
JS priority queue
李宏毅《机器学习》丨4. Deep Learning(深度学习)
Stm32f103c8t6 + 0.96 "I2C OLED display 3d_cube