计算机二级[英文]-C 逻辑运算和fopen—东方仙盟

一、Bitwise Operations(位运算)

Examination Point 4: Bitwise Operations

  1. C language provides 6 bitwise operators
  • Bitwise AND (&): If both corresponding binary bits are 1, the result of this bit is 1; otherwise it is 0.
  • Bitwise OR (|): If one of the two corresponding binary bits is 1, the result of this bit is 1; otherwise it is 0.
  • Bitwise XOR (^): If the two binary bits are the same, the result is 0; if different, the result is 1.
  • Bitwise NOT (~): Bitwise inversion. 0 becomes 1, and 1 becomes 0.
  • Left shift (<<): Shift all binary bits of a number to the left by several positions.
  • Right shift (>>): Shift all binary bits of a number to the right by several positions.
  1. Notes
  • Except for Bitwise NOT, all other bitwise operators are binary operators. Each side requires one operand.
  • Operands can only be integer or char type data; floating-point data is not allowed.

二、fopen () Function(文件打开函数)

Examination Point3: File Opening and Closing

  1. fopen() function (1) General calling format: fopen(filename, file usage mode);
  • The function returns a pointer of FILE type.
  • No matter which mode is used, if an error occurs when opening the file, fopen will return NULL.

(2) Common file usage modes and meanings:

  • "r": Open a text file for reading.
  • "rb": Open a binary file for reading.
  • "w": Open a text file for writing.
  • "wb": Open a binary file for writing.
  • "a": Append to the end of a text file.
  • "ab": Append to the end of a binary file.
  • "r+": Open a text file for reading and writing.
  • "rb+": Open a binary file for reading and writing.
  • "w+": First create a new file for reading and writing. If the specified file already exists, its original content will be completely erased.
  • "wb+": The function is the same as "w+", only reading and writing operations are performed on binary files.
  • "a+": Can read and write. It only adds new data after the end of the file. Reading can start from the beginning.
  • "ab+": The function is the same as "a+". New data is appended at the end of the file. After adding new data, the starting position for reading can be set by the position function.
  1. fclose() function

术语严格使用 C 语言标准英文,没有自由意译:

  • binary operator:双目运算符
  • operand:运算对象
  • integer:整型
  • character type:字符型
  • floating-point /real type:实型
  • text file:文本文件
  • binary file:二进制文件
  • append:追加

人人皆为创造者,共创方能共成长

每个人都是使用者,也是创造者;是数字世界的消费者,更是价值的生产者与分享者。在智能时代的浪潮里,单打独斗的发展模式早已落幕,唯有开放连接、创意共创、利益共享,才能让个体价值汇聚成生态合力,让技术与创意双向奔赴,实现平台与伙伴的快速成长、共赢致远。

原创永久分成,共赴星辰大海

原创创意共创、永久收益分成,是东方仙盟始终坚守的核心理念。我们坚信,每一份原创智慧都值得被尊重与回馈,以永久分成锚定共创初心,让创意者长期享有价值红利,携手万千伙伴向着科技星辰大海笃定前行,拥抱硅基 生命与数字智能交融的未来,共筑跨越时代的数字文明共同体。

东方仙盟:拥抱知识开源,共筑数字新生态

在全球化与数字化浪潮中,东方仙盟始终秉持开放协作、知识共享的理念,积极拥抱开源技术与开放标准。我们相信,唯有打破技术壁垒、汇聚全球智慧,才能真正推动行业的可持续发展。

开源赋能中小商户:通过将前端异常检测、跨系统数据互联等核心能力开源化,东方仙盟为全球中小商户提供了低成本、高可靠的技术解决方案,让更多商家能够平等享受数字转型的红利。

共建行业标准:我们积极参与国际技术社区,与全球开发者、合作伙伴共同制定开放协议 与技术规范,推动跨境零售、文旅、餐饮等多业态的系统互联互通,构建更加公平、高效的数字生态。

知识普惠,共促发展:通过开源社区 、技术文档与培训体系,东方仙盟致力于将前沿技术转化为可落地的行业实践,赋能全球合作伙伴,共同培育创新人才,推动数字经济 的普惠式增长

阿雪技术观

在科技发展浪潮中,我们不妨积极投身技术共享。不满足于做受益者,更要主动担当贡献者 。无论是分享代码、撰写技术博客,还是参与开源项目 维护改进,每一个微小举动都可能蕴含推动技术进步的巨大能量。东方仙盟是汇聚力量的天地,我们携手在此探索硅基 生命,为科技进步添砖加瓦。

Hey folks, in this wild tech - driven world, why not dive headfirst into the whole tech - sharing scene? Don't just be the one reaping all the benefits; step up and be a contributor too. Whether you're tossing out your code snippets , hammering out some tech blogs, or getting your hands dirty with maintaining and sprucing up open - source projects, every little thing you do might just end up being a massive force that pushes tech forward. And guess what? The Eastern FairyAlliance is this awesome place where we all come together. We're gonna team up and explore the whole silicon - based life thing, and in the process, we'll be fueling the growth of technology

相关推荐
乌暮11 小时前
深入理解 Java 泛型:把「万能盒子」用对、用稳
java·开发语言·后端·学习
2601_9622186111 小时前
C语言中三种库的编译和使用方法
开发语言·c++
铅笔小新z11 小时前
【C语言】操作符
c语言
传奇开心果编程11 小时前
中庸、有容、破执:仓颉编程语言的中华智慧结晶——三重哲学境界思辨
开发语言·华为·开源·软件工程
jimy111 小时前
派生类重写基类虚函数(二):override的作用
开发语言·c++
_upupup12 小时前
异常(C++)
java·开发语言·jvm
霸道流氓气质12 小时前
ComfyUI 图像生成工作流完全指南:从节点编排到Java生产级图像生产实战
java·开发语言·人工智能
by2099912 小时前
从 malloc/free 到 new/delete:真正理解 C++ 中的内存管理与对象生命周期
c语言·c++·经验分享·动态内存管理
额额额对了12 小时前
SPI通信
linux·c语言·汇编·单片机·嵌入式硬件·arm
ShyanZh13 小时前
【Python3基础】13-Python 常用设计模式
开发语言·python·设计模式