当前位置: 首页 > news >正文

网站制作报价乐清网络

网站制作报价,乐清网络,版式设计排版,网站做等保是什么意思清除缓存 c语言Given a number and we have to 1) set a bit, 2) clear a bit and 3) toggle a bit. 给定一个数字#xff0c;我们必须1)设置一个位#xff0c;2)清除一个位#xff0c;3)切换一个位。 1)设置一点 (1) Setting a bit) To set a particular bit of a number,…清除缓存 c语言Given a number and we have to 1) set a bit, 2) clear a bit and 3) toggle a bit. 给定一个数字我们必须1)设置一个位2)清除一个位3)切换一个位。 1)设置一点 (1) Setting a bit) To set a particular bit of a number, we can use bitwise OR operator (|), it sets the bits – if the bit is not set, and if the bit is already set, bit’s status does not change. 要设置数字的特定位我们可以使用按位或运算符( | )它设置位–如果未设置位并且如果该位已设置则位的状态不会改变。 Let suppose there is a number num and we want to set the Xth bit of it, then the following statement can be used to set Xth bit of num 让我们假设有一个数NUM我们要设置X的第这一点那么下面的语句可以用来设置X的num 个位 num | 1 x; 2)清除一点 (2) Clearing a bit) To clear a particular bit of a number, we can use bitwise AND operator (), it clears the bit – if the bit is set, and if the bit is already cleared, bit’s status does not change. 要清除数字的特定位我们可以使用按位AND运算符()清除该位–如果该位已设置并且如果该位已被清除则位的状态不会更改。 Let suppose there is a number num and we want to clear the Xth bit of it, then the following statement can be used to clear Xth bit of num 让我们假设有一个数NUM我们要清除的第 X的这一点那么下面的语句可以用于清除X的num 个位 num ~(1 x); 3)切换一点 (3) Toggling a bit) To toggle a particular bit of a number, we can use bitwise XOR operator (^), it toggles the bit – it changes the status of the bit if the bit is set – it will be un-set, and if the bit is un-set – it will be set. 要切换某个数字的特定位我们可以使用按位XOR运算符(^)它会切换该位–如果该位被设置它将更改该位的状态–将被取消设置并且如果该位未被设置 -set –将被设置。 Let suppose there is a number num and we want to toggle the Xth bit of it, then the following statement can be used to toggle Xth bit of num 让我们假设有一个数NUM我们要切换X的第这一点那么下面的语句可以用来切换第 X NUM位 num ^ 1 x;Consider the following code – Here, we are performing all above mentioned operations 考虑以下代码–在这里我们正在执行上述所有操作 #include stdio.h int main(){ //declaring initializing an 1 byte number /* num (hex) 0xAA its binary 1010 1010 its decimal value 170 */ unsigned char num 0xAA; printf(num %02X\n, num); //setting 2nd bit num | (12); //now value will be: 1010 1110 0xAE (HEX) 174 (DEC) printf(num %02X\n, num); //clearing 3rd bit num ~(13); //now value will be: 1010 0110 0xA6 (HEX) 166 (DEC) printf(num %02X\n, num); //toggling bit 4th bit num ^ (14); //now value will be: 1011 0110 0xB6 (HEX) 182 (DEC) printf(num %02X\n, num); //toggling bit 5th bit num ^ (15); //now value will be: 1001 0110 0x96 (HEX) 150 (DEC) printf(num %02X\n, num); return 0; } Output 输出量 num AA num AE num A6 num B6 num 96Read more... ... Hexadecimal literals in C language C语言的十六进制文字 Working with hexadecimal values in C language 使用C语言处理十六进制值 How to check whether a bit is SET or not in C language? 如何检查C语言中的SET是否设置 unsigned char in C language C语言中的未签名字符 Bitwise operator programs in C C语言中的按位运算符程序 翻译自: https://www.includehelp.com/c/how-to-set-clear-and-toggle-a-single-bit-in-c-language.aspx清除缓存 c语言
http://www.zqtcl.cn/news/736825/

相关文章:

  • 自己做网站的难度建设专门网站 强化信息宣传
  • 公职单位建设网站的目的如何查看小程序的开发公司
  • 网页模板网站推荐青岛 php 网站建设
  • joomla 网站建设3d网站建设
  • 网站开发与维护专业前景网站被禁止访问怎么打开
  • 山东 网站建设青海公路建设市场信用信息服务网站
  • 济南正规做网站公司wordpress一键还原
  • 免费的购物网站源码百度网站优化
  • 企业需要做网站吗深圳装修公司前十强
  • 合肥做网站推广哪家好软文写作的十大技巧
  • 哪里做网站的wordpress歌词插件
  • 网站改版做301重定向百度站长平台查询
  • 织梦网站后台网址妙影免费模板下载
  • 甘肃网站建设开发怎么利用花生壳做自己的网站
  • 怎么查询网站开通时间建个短视频网站
  • 物流网站建设广东网站建设效果
  • 网站推广工作流程图天蝎网站建设
  • 备案ip 查询网站查询网站校园门户网站建设方案
  • 网站seo快速优化技巧建设网站的需要学习哪些课程
  • 网站建设微信托管wordpress p=
  • 专业手机网站制作哪家好吉林建筑大学本科招生网
  • 建立一个网站需要哪些google和百度等相关网站的广告词
  • 手机开发网站教程做古建的那些网站比较适合
  • 网站建设公司的前景长沙商城网站开发
  • 大型网站tag标签 索引自己做网站需要哪些软件
  • 石排做网站万网网站备案流程
  • 南京建设银行网站首页简单的ui界面制作
  • 门户网站 建设 如何写如何布置网站
  • 网站前台功能模块介绍建设银行信用卡网站是哪个好
  • 用python做网站我那些网站开发开发语言